|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcaltool.caldb.ItemKey
public class ItemKey
Class ItemKey is the Map key used to store items in a user calendar. It has five fields, some or all of which are used as the key for an item, per the following table:
Field Used For: Appt Meeting Task Event ===================================================== date yes yes yes yes time yes yes yes no duration yes yes no no title yes yes yes yes priority no no yes noItemKey is suitable for use in either a HashMap or a TreeMap, since it specializes Object.hashCode (for the HashMap) and implements Comparable (for the TreeMap).
Field Summary | |
---|---|
protected Date |
date
The date field used in all keys |
protected Duration |
duration
The duration field used in appointment and meeting keys |
protected Time |
time
The time field used in all keys except for events |
protected java.lang.String |
title
The title field used in all keys |
Constructor Summary | |
---|---|
ItemKey(Date date,
Time time,
Duration duration,
java.lang.String title,
int priority)
Construct this with the given field values. |
Method Summary | |
---|---|
protected int |
compareAppointmentKeys(ItemKey apptKey)
Compare this and the given appointment/meeting key. |
protected int |
compareTaskKeys(ItemKey taskKey)
Compare this and the given task key. |
int |
compareTo(java.lang.Object o)
Define compareTo based on the total ordering of items defined in the spec. |
boolean |
equals(java.lang.Object obj)
Define equality for this as componentwise equality. |
int |
hashCode()
Define this' hash code as the sum of component hash codes. |
protected boolean |
isEventKey()
Return true if this is an event key. |
protected boolean |
isTaskKey()
Return true if this is a task key. |
java.lang.String |
toString()
Convert this to a string representation. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Date date
protected Time time
protected Duration duration
protected java.lang.String title
Constructor Detail |
---|
public ItemKey(Date date, Time time, Duration duration, java.lang.String title, int priority)
Method Detail |
---|
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public java.lang.String toString()
toString
in class java.lang.Object
protected int compareAppointmentKeys(ItemKey apptKey)
protected int compareTaskKeys(ItemKey taskKey)
protected boolean isEventKey()
protected boolean isTaskKey()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |