|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectm865.datastructures.PrioritizedItem
public class PrioritizedItem
The PrioritizedItem class contains objects which consist of a comparable object which represents the explicit priority, and a general object which is the prioritized datum.
Field Summary | |
---|---|
protected java.lang.Object |
datum
The general object which the datum. |
protected java.lang.Comparable |
priority
The Comparable object which designates the priority. |
Constructor Summary | |
---|---|
PrioritizedItem()
Default constuctor |
|
PrioritizedItem(java.lang.Comparable p,
java.lang.Object obj)
General Constructor |
Method Summary | |
---|---|
boolean |
adjustPriority(java.lang.Comparable p)
Adjusts the priority of this object |
java.lang.Object |
clone()
Creates a clone of this object |
int |
compareTo(java.lang.Object pqi)
The compareTo method required by the Comparable interface If the priorities are comparable this returns an int specifying the relation between the two priorities. |
boolean |
equals(java.lang.Object obj)
Tests for the equality of this object with a specified object |
java.lang.Object |
getDatum()
Get the datum of this object |
java.lang.Comparable |
getPriority()
Get the priority of this object |
int |
hashCode()
Calculates the hashCode |
void |
setDatum(java.lang.Object obj)
Set the dataum of this object |
void |
setPriority(java.lang.Comparable p)
Set the priority of this object |
java.lang.String |
toString()
Display this prioritized item |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.Comparable priority
protected java.lang.Object datum
Constructor Detail |
---|
public PrioritizedItem(java.lang.Comparable p, java.lang.Object obj)
p
- the priority of the Prioritized itemobj
- the datum of the Prioritized itempublic PrioritizedItem()
Method Detail |
---|
public void setPriority(java.lang.Comparable p)
p
- the prioritypublic java.lang.Comparable getPriority()
public void setDatum(java.lang.Object obj)
obj
- the datum of this objectpublic java.lang.Object getDatum()
public boolean adjustPriority(java.lang.Comparable p)
adjustPriority
in interface Prioritizeable
p
- the new priority
public int compareTo(java.lang.Object pqi)
compareTo
in interface java.lang.Comparable
pqi
- the specified object which should be a PrioritizedItem
public java.lang.Object clone()
clone
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the specified object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |