infrastructure
Class Sorter

java.lang.Object
  extended by infrastructure.Sorter
All Implemented Interfaces:
java.lang.Comparable

public class Sorter
extends java.lang.Object
implements java.lang.Comparable

Sorts agents based on their age


Field Summary
 int age
           
 int id
           
 
Constructor Summary
Sorter(int _id, int _age)
           
 
Method Summary
 int compareTo(java.lang.Object anotherAgent)
           
 int getAge()
           
 int getId()
           
 void setAge(int age)
           
 void setId(int id)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

age

public int age

id

public int id
Constructor Detail

Sorter

public Sorter(int _id,
              int _age)
Method Detail

compareTo

public int compareTo(java.lang.Object anotherAgent)
              throws java.lang.ClassCastException
Specified by:
compareTo in interface java.lang.Comparable
Throws:
java.lang.ClassCastException

getAge

public int getAge()

setAge

public void setAge(int age)

getId

public int getId()

setId

public void setId(int id)