Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/fenceui/beans/FencerList.java


1   
2   package org.fenceui.beans;
3   
4   import java.util.List;
5   import java.util.Vector;
6   import java.text.DateFormat;
7   
8   import org.fencedb.base.Fencer;
9   
10  /**
11   *  Description of the Class
12   *
13   * @author  vico
14   * @created  June 11, 2003
15   */
16  public class FencerList
17  {
18  
19      List fencerList;
20      int index;
21  
22  
23      /**
24       *Constructor for the FencerList object
25       *
26       * @param  fencerList Description of the Parameter
27       */
28      public FencerList(List fencerList)
29      {
30          if (fencerList == null) {
31              fencerList = (List)new Vector();
32          }
33          this.fencerList = fencerList;
34          this.index = 0;
35      }
36  
37  
38      /**
39       *  Gets the size attribute of the FencerList object
40       *
41       * @return  The size value
42       */
43      public int getSize()
44      {
45          return fencerList.size();
46      }
47  
48  
49      /**
50       *  Sets the index attribute of the FencerList object
51       *
52       * @param  index The new index value
53       */
54      public void setIndex(int index)
55      {
56          this.index = index;
57      }
58  
59  
60      /**
61       *  Gets the fencer attribute of the FencerList object
62       *
63       * @return  The fencer value
64       */
65      public Fencer getFencer()
66      {
67          return (Fencer)fencerList.get(index);
68      }
69  
70  
71      /**
72       *  Gets the firstName attribute of the FencerList object
73       *
74       * @return  The firstName value
75       */
76      public String getFirstName()
77      {
78          return getFencer().getFirstName();
79      }
80  
81  
82      /**
83       *  Gets the lastName attribute of the FencerList object
84       *
85       * @return  The lastName value
86       */
87      public String getLastName()
88      {
89          return getFencer().getLastName();
90      }
91  
92  
93      /**
94       *  Gets the country attribute of the FencerList object
95       *
96       * @return  The country value
97       */
98      public String getCountry()
99      {
100         if (getFencer().getCountry() == null) {
101             return "";
102         }
103         return getFencer().getCountry().getName();
104     }
105 
106 
107     /**
108      *  Gets the club attribute of the FencerList object
109      *
110      * @return  The club value
111      */
112     public String getClub()
113     {
114         String result;
115         if (getFencer().getClub() == null) {
116             result = "";
117         }
118         else {
119             result = getFencer().getClub().getShortName();
120         }
121         return result;
122     }
123 
124 
125     /**
126      *  Gets the birthDate attribute of the FencerList object
127      *
128      * @return  The birthDate value
129      */
130     public String getBirthDate()
131     {
132         if (getFencer().getBirthDate() == null) {
133             return "";
134         }
135         DateFormat df = DateFormat.getDateInstance();
136         return df.format(getFencer().getBirthDate());
137     }
138 
139 }
140