nl.tudelft.simulation.messaging.comparators
Class FieldComparator

java.lang.Object
  extended bynl.tudelft.simulation.messaging.comparators.FieldComparator
All Implemented Interfaces:
java.util.Comparator, java.io.Serializable
Direct Known Subclasses:
FiFo, PriorityCompare

public class FieldComparator
extends java.lang.Object
implements java.util.Comparator, java.io.Serializable

A FieldComparator
Copyright (c) 2003-2005 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information www.simulation.tudelft.nl . The source code and binary code of this software is proprietary information of Delft University of Technology.

Version:
$$Revision: 1.3 $$ $$Date: 2005/04/08 11:29:12 $$
Author:
Peter Jacobs
See Also:
Serialized Form

Field Summary
protected  java.lang.String fieldName
          the field to question
protected  boolean negative
          normal of negative operation
protected  java.util.Comparator next
          the next comparator in the chain
 
Constructor Summary
FieldComparator(java.lang.String field)
          constructs a new FieldComparator
FieldComparator(java.lang.String field, java.util.Comparator next)
          constructs a new FieldComparator
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
           
 boolean isNegative()
           
 void setNegative(boolean negative)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Field Detail

fieldName

protected java.lang.String fieldName
the field to question


next

protected java.util.Comparator next
the next comparator in the chain


negative

protected boolean negative
normal of negative operation

Constructor Detail

FieldComparator

public FieldComparator(java.lang.String field)
constructs a new FieldComparator

Parameters:
field - the field to compare to

FieldComparator

public FieldComparator(java.lang.String field,
                       java.util.Comparator next)
constructs a new FieldComparator

Parameters:
field - the field to compare to
next - the next comparator to use
Method Detail

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Specified by:
compare in interface java.util.Comparator
See Also:
Comparator.compare(java.lang.Object, java.lang.Object)

isNegative

public boolean isNegative()
Returns:
Returns the negative.

setNegative

public void setNegative(boolean negative)
Parameters:
negative - The negative to set.


Copyright © 2004-2005 Delft University of Technology, the Netherlands. All Rights Reserved.