info.aduna.gee.spectacle.gee
Class FieldComparator

java.lang.Object
  extended by info.aduna.gee.spectacle.gee.FieldComparator
All Implemented Interfaces:
Comparator<Entity>

public class FieldComparator
extends Object
implements Comparator<Entity>

Most applications require a kind of natural ordening within the set of objects. The EntityContext may contain a single field or a list of fields that control the fields by which the set of objects should be ordered before rendering. To perform the ordening, an instance of the current FieldComparator class is created to compare two Entities with respect to the values of their order field(s).


Constructor Summary
FieldComparator(List<String> orderFields)
           
FieldComparator(String orderField)
           
 
Method Summary
 int compare(Entity one, Entity other)
           
 
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
 

Constructor Detail

FieldComparator

public FieldComparator(List<String> orderFields)
Parameters:
orderFields - the sorted list of fields that control the ordening.

FieldComparator

public FieldComparator(String orderField)
Parameters:
orderField - the single field that controls the ordening.
Method Detail

compare

public int compare(Entity one,
                   Entity other)
Specified by:
compare in interface Comparator<Entity>


Copyright © 1997-2008 Aduna. All Rights Reserved.