| 1 |
pjm2 |
1.1 |
//---PACKAGE DECLARATION--- |
| 2 |
|
|
|
| 3 |
|
|
//---IMPORTS--- |
| 4 |
|
|
|
| 5 |
|
|
/** |
| 6 |
|
|
* An object to store page/link data. |
| 7 |
|
|
* |
| 8 |
pjm2 |
1.2 |
* @author $Author: pjm2 $ |
| 9 |
|
|
* @version $Id: ReportPage.java,v 1.1 2000/12/11 21:26:46 pjm2 Exp $ |
| 10 |
pjm2 |
1.1 |
*/ |
| 11 |
|
|
public class ReportPage { |
| 12 |
|
|
|
| 13 |
|
|
//---FINAL ATTRIBUTES--- |
| 14 |
|
|
|
| 15 |
|
|
/** |
| 16 |
|
|
* The current CVS revision of this class |
| 17 |
|
|
*/ |
| 18 |
pjm2 |
1.2 |
public final String REVISION = "$Revision: 1.1 $"; |
| 19 |
pjm2 |
1.1 |
|
| 20 |
|
|
//---STATIC METHODS--- |
| 21 |
|
|
|
| 22 |
|
|
//---CONSTRUCTORS--- |
| 23 |
|
|
|
| 24 |
|
|
public ReportPage(String location, String description, int type){ |
| 25 |
|
|
|
| 26 |
pjm2 |
1.2 |
if (type < HOUR || type > MONTH){ |
| 27 |
pjm2 |
1.1 |
System.out.println("Could not add the page."); |
| 28 |
|
|
} |
| 29 |
|
|
|
| 30 |
|
|
_location = location; |
| 31 |
|
|
_description = description; |
| 32 |
|
|
_type = type; |
| 33 |
|
|
} |
| 34 |
|
|
|
| 35 |
|
|
//---PUBLIC METHODS--- |
| 36 |
|
|
|
| 37 |
|
|
|
| 38 |
|
|
/** |
| 39 |
|
|
* Overrides the {@link java.lang.Object#toString() Object.toString()} |
| 40 |
|
|
* method to provide clean logging (every class should have this). |
| 41 |
|
|
* |
| 42 |
|
|
* @return the name of this class and its CVS revision |
| 43 |
|
|
*/ |
| 44 |
|
|
public String toString() { |
| 45 |
|
|
return this.getClass().getName() + "(" + REVISION.substring(11, REVISION.length() - 2) + ")"; |
| 46 |
|
|
} |
| 47 |
|
|
|
| 48 |
|
|
//---PRIVATE METHODS--- |
| 49 |
|
|
|
| 50 |
|
|
|
| 51 |
|
|
//---ACCESSOR/MUTATOR METHODS--- |
| 52 |
|
|
|
| 53 |
|
|
public String getLocation(){ |
| 54 |
|
|
return _location; |
| 55 |
|
|
} |
| 56 |
|
|
|
| 57 |
|
|
public String getDescription(){ |
| 58 |
|
|
return _description; |
| 59 |
|
|
} |
| 60 |
|
|
|
| 61 |
|
|
public int getType(){ |
| 62 |
|
|
return _type; |
| 63 |
|
|
} |
| 64 |
|
|
|
| 65 |
|
|
|
| 66 |
|
|
//---ATTRIBUTES--- |
| 67 |
|
|
|
| 68 |
|
|
private String _location; |
| 69 |
|
|
private String _description; |
| 70 |
|
|
private int _type; |
| 71 |
|
|
|
| 72 |
|
|
//---STATIC ATTRIBUTES--- |
| 73 |
|
|
|
| 74 |
|
|
public static int HOUR = 0; |
| 75 |
|
|
public static int DAY = 1; |
| 76 |
|
|
public static int WEEK = 2; |
| 77 |
|
|
public static int MONTH = 3; |
| 78 |
|
|
|
| 79 |
|
|
} |