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