org.jppf.server.queue
Class JPPFPriority

java.lang.Object
  extended by org.jppf.server.queue.JPPFPriority
All Implemented Interfaces:
Serializable, Comparable<JPPFPriority>

public class JPPFPriority
extends Object
implements Comparable<JPPFPriority>, Serializable

Encapsulation of an integer value as a priority. This class also defines its natural order as a descending order of priority values.

Author:
Laurent Cohen
See Also:
Serialized Form

Constructor Summary
JPPFPriority(int value)
          Initialize this priority witht he specified object.
 
Method Summary
 int compareTo(JPPFPriority o)
          Compare this priority with another.
 boolean equals(Object obj)
          Indcates whether some object is "equal" to this one.
 int getValue()
          Get the actual value of the priority.
 int hashCode()
          Return a hashcode value for this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JPPFPriority

public JPPFPriority(int value)
Initialize this priority witht he specified object.

Parameters:
value - the object used as priority.
Method Detail

compareTo

public int compareTo(JPPFPriority o)
Compare this priority with another. This method defines a descending order of priority values, meaning a higher priority will come before a lower one.

Specified by:
compareTo in interface Comparable<JPPFPriority>
Parameters:
o - the priority to compare with.
Returns:
a positive value if this priority is greater, a negative value if it is less, otherwise 0.
See Also:
Comparable.compareTo(java.lang.Object)

getValue

public int getValue()
Get the actual value of the priority.

Returns:
the priority as an integer value.

equals

public boolean equals(Object obj)
Indcates whether some object is "equal" to this one.

Overrides:
equals in class Object
Parameters:
obj - the object ot compare with.
Returns:
true if the 2 objects are equal, false otherwise.
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Return a hashcode value for this object.

Overrides:
hashCode in class Object
Returns:
the priority value.
See Also:
Object.hashCode()


Copyright © 2005-2010 JPPF Team.