/Users/lyon/j4p/src/net/server/servlets/Student.java

1    package net.server.servlets; 
2     
3    /** 
4     * The Student class encapsulates the functionality 
5     * required to represent a student. The data members of 
6     * the class hold pertinent information such as the 
7     * first and last names and middle initial of the student 
8     * as well as the student's identification, or record number. 
9     * Getter methods are supplied to obtain each of these data 
10    * members. The constructor of the class enables the 
11    * setting of each of these parameters. 
12    * 
13    * @author Robert Lysik 
14    * @version 1.00 
15    */ 
16   class Student { 
17       private String firstName; 
18       private String lastName; 
19       private String middleInitial; 
20       private int studentRecordNumber; 
21    
22       /** 
23        * This is the default constructor for the 
24        * Student class. 
25        */ 
26       Student() { 
27       } 
28    
29       /** 
30        * This Student constructor enables the setting of each 
31        * of the member variables of the Student class. 
32        * 
33        */ 
34       Student(String first, 
35               String middle, 
36               String last, 
37               int number) { 
38           firstName = first; 
39           lastName = last; 
40           middleInitial = middle; 
41           studentRecordNumber = number; 
42       } 
43    
44       /** 
45        * This is the getter method for the student's first 
46        * name. 
47        */ 
48       public String getFirstName() { 
49           return firstName; 
50       } 
51    
52       /** 
53        * This is the getter method for the student's full 
54        * name. The name is a composite of the first name, 
55        * middle initial and last name. 
56        */ 
57       public String getFullName() { 
58           return firstName + " " + middleInitial + ". " + lastName; 
59       } 
60    
61       /** 
62        * This is the getter method for the student's last 
63        * name. 
64        */ 
65       public String getLastName() { 
66           return lastName; 
67       } 
68    
69       /** 
70        * This is the getter method for the student's middle 
71        * initial. 
72        */ 
73       public String getMiddleInitial() { 
74           return middleInitial; 
75       } 
76    
77       /** 
78        * This is the getter method for the student's record 
79        * number. 
80        */ 
81       public int getStudentRecordNumber() { 
82           return studentRecordNumber; 
83       } 
84    
85       /** 
86        * This is the setter method for the student's first 
87        * name. 
88        */ 
89       public void setFirstName(String fname) { 
90           firstName = fname; 
91       } 
92    
93       /** 
94        * This is the setter method for the student's last 
95        * name. 
96        */ 
97       public void setLastName(String lname) { 
98           lastName = lname; 
99       } 
100   
101      /** 
102       * This is the setter method for the student's middle 
103       * initial. 
104       */ 
105      public void setMiddleInitial(String mname) { 
106          middleInitial = mname; 
107      } 
108   
109      /** 
110       * This is the setter method for the student's record 
111       * number. 
112       */ 
113      public void setStudentRecordNumber(int srnumber) { 
114          studentRecordNumber = srnumber; 
115      } 
116  }