Class FieldComparator

java.lang.Object
com.singularsys.extensions.field.FieldComparator
All Implemented Interfaces:
Serializable, Comparator<Object>

public class FieldComparator extends Object implements Comparator<Object>, Serializable
A comparator which works using a field. If the field is an AbstractComparativeField it uses its cmp method, otherwise first the arguments are tested for equality using the eq method and if non equal the lt is used.
See Also:
  • Constructor Details

    • FieldComparator

      public FieldComparator(FieldI fm, boolean increasing)
      Constructor
      Parameters:
      fm - field used to make the comparison
      increasing - whether to sort in an increasing or decreasing order
    • FieldComparator

      public FieldComparator(FieldI fm)
  • Method Details