Repository
Class DateArch

java.lang.Object
  extended byRepository.DateArch
All Implemented Interfaces:
java.lang.Comparable

class DateArch
extends java.lang.Object
implements java.lang.Comparable

Key of the TreeMap used for date sorted display. Implements Comparable consistent with equals.

alexis.grandemange@pagebox.net

Copyright (c) 2002-2004 Alexis Grandemange

This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public License
 as published by the Free Software Foundation; version 2.1 of the
 License.
 This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 GNU Lesser General Public License for more details.
 A copy of the GNU Lesser General Public License lesser.txt should be
 included in the distribution.

Version:
0, 0, 6
Author:
Alexis Grandemange

Field Summary
(package private)  java.lang.String arch
          Archive name
(package private)  java.lang.String date
          Date when the archive was published
(package private)  boolean order
          true if ascending order of date
 
Constructor Summary
(package private) DateArch(java.lang.String date, java.lang.String arch, boolean order)
          Constructor.
 
Method Summary
 int compareTo(java.lang.Object o)
          Method of the Comparable interface.
 boolean equals(java.lang.Object o)
          Method of Object overriden to be consistent with compareTo.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

date

java.lang.String date
Date when the archive was published


arch

java.lang.String arch
Archive name


order

boolean order
true if ascending order of date

Constructor Detail

DateArch

DateArch(java.lang.String date,
         java.lang.String arch,
         boolean order)
Constructor.

Parameters:
date - date when the archive was published
arch - archive name
order - true if ascending order of date
Method Detail

compareTo

public int compareTo(java.lang.Object o)
              throws java.lang.ClassCastException
Method of the Comparable interface. Compares the date depending on the order. When dates equal compares the arch names (always ascending order)

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - object to compare
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object
Throws:
java.lang.ClassCastException

equals

public boolean equals(java.lang.Object o)
Method of Object overriden to be consistent with compareTo.

Parameters:
o - object to compare
Returns:
true if this object equals the obj argument