Class FeatureComparators


  • public final class FeatureComparators
    extends Object
    A utility class for creating simple Comparators for Features.
    Author:
    Ian Schneider
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  FeatureComparators.Index
      A Comparator which performs the comparison on attributes at a given index.
      static class  FeatureComparators.Name
      A Comparator which performs the comparison on attributes with a given name.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static Comparator BY_ID
      A utility comparator for comparison by id.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Comparator byAttributeIndex​(int idx)
      Create a Comparator which compares Features by the attribute at the given index.
      static Comparator byAttributeName​(String name)
      Create a Comparator which compares Features by the attribute found at the given path.
      • Methods inherited from class Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • BY_ID

        public static final Comparator BY_ID
        A utility comparator for comparison by id.
    • Method Detail

      • byAttributeIndex

        public static Comparator byAttributeIndex​(int idx)
        Create a Comparator which compares Features by the attribute at the given index. The attribute at the index MUST be Comparable. This will probably not work for heterogenous collections, UNLESS the classes at the given index are the same.
        Parameters:
        idx - The index to look up attributes at.
        Returns:
        A new Comparator.
      • byAttributeName

        public static Comparator byAttributeName​(String name)
        Create a Comparator which compares Features by the attribute found at the given path. The attribute found MUST be Comparable. This will probably not work for heterogenous collections, UNLESS the attributes found are the same class.
        Parameters:
        name - The xpath to use while comparing.
        Returns:
        A new Comparator.