PkgAgentSystem.Experiences
Class ValueComparator
java.lang.Object
|
+--PkgAgentSystem.Experiences.ValueComparator
- public class ValueComparator
- extends Object
- implements Comparator
Compares two agent identity objects according to a certain characteristic.
Used for sorting.
- Version:
- 1.0, 1.7.2000
- Author:
- Michael Sonntag
Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
exp
protected Experiences exp
- The
Experiences
object
characteristic
protected String characteristic
- The characteristic to compare
ValueComparator
public ValueComparator(Experiences exp,
String characteristic)
- Creates a new comparator which compares a certain characteristic.
- Parameters:
exp
- the experiences object in which to comparecharacteristic
- the characteristic to compare
compare
public int compare(Object o1,
Object o2)
- Compares its two arguments for order. Returns a negative integer, zero, or a positive integer
as the first argument is less than, equal to, or greater than the second.
- Specified by:
- compare in interface Comparator
- Parameters:
o1
- the first object to compareo2
- the second object to compare- Returns:
- a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second
- Throws:
- ClassCastException - if the arguments' types are not both of class
AgentIdentity
Submit a bug
Copyright 2000 Michael Sonntag & Institute for Information Processing and Microprocessor Technology (FIM), Johannes-Kepler-University Linz, Altenbergerstr. 69, A-4040 Linz, Austria.