story.scheherazade.nodes
Class StateNodeComparator

java.lang.Object
  extended by story.scheherazade.nodes.StateNodeComparator
All Implemented Interfaces:
java.util.Comparator

public class StateNodeComparator
extends java.lang.Object
implements java.util.Comparator

An implementation of the Comparator interface that allows comparisons between two State nodes (or, more precisely, NodeAddresses) so that other classes can sort States by time.


Constructor Summary
StateNodeComparator(DBCAccessor dbca)
           
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
          Compare two State NodeAddresses.
 boolean equals(java.lang.Object obj)
          Determines if this Comparator is equivalent to some other Comparator.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StateNodeComparator

public StateNodeComparator(DBCAccessor dbca)
Method Detail

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
            throws java.lang.ClassCastException
Compare two State NodeAddresses. Runs compare over the two "time" attributes.

Specified by:
compare in interface java.util.Comparator
Throws:
java.lang.ClassCastException

equals

public boolean equals(java.lang.Object obj)
Determines if this Comparator is equivalent to some other Comparator.

Specified by:
equals in interface java.util.Comparator
Overrides:
equals in class java.lang.Object


Copyright © 2011 David K. Elson. All Rights Reserved.