home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-08-14 | 1.1 KB | 53 lines |
- // TsolException.java
- // 22.03.96
- //
- // on one of these days, use Sunday hours
-
- package cybcerone.main;
-
- import java.io.DataInputStream;
- import java.io.IOException;
-
- import cybcerone.utils.Date;
- import cybcerone.utils.Literate;
-
- /**
- * These are holidays where the metro runs according to Sunday hours.
- */
- class TsolException implements Literate {
- private Date theDate;
-
- private String line; /* for reading */
-
- public TsolException (Date theDate) {
- this.theDate = theDate;
- }
-
- /* for reading */
- public TsolException () {
- }
-
- public Object read (DataInputStream inStream) throws IOException {
- line = inStream.readLine ();
-
- if (line != null)
- return new TsolException
- (new Date (Integer.parseInt (line.substring (6)) - 1900,
- Integer.parseInt (line.substring (3, 5)),
- Integer.parseInt (line.substring (0, 2))));
- else
- return null;
- }
-
- public String toString () {
- return ("TsolException[" + theDate + "]");
- }
-
- public boolean contains (Date aDate) {
- return (aDate.getDate () == theDate.getDate () &&
- aDate.getMonth () == theDate.getMonth () &&
- aDate.getYear () == theDate.getYear ());
- }
-
- }
-