org.geotools.feature
Class FeatureComparators.Index

java.lang.Object
  extended byorg.geotools.feature.FeatureComparators.Index
All Implemented Interfaces:
java.util.Comparator
Enclosing class:
FeatureComparators

public static class FeatureComparators.Index
extends java.lang.Object
implements java.util.Comparator

A Comparator which performs the comparison on attributes at a given index.


Constructor Summary
FeatureComparators.Index(int i)
          Create a new Comparator based on the given index.
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
          Implementation of Comparator.
protected  int compareAtts(java.lang.Object att1, java.lang.Object att2)
          Compares the two attributes.
 
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

FeatureComparators.Index

public FeatureComparators.Index(int i)
Create a new Comparator based on the given index.

Parameters:
i - The index.
Method Detail

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Implementation of Comparator. Calls compareAtts to perform the actual comparison.

Specified by:
compare in interface java.util.Comparator
Parameters:
o1 - The first Feature.
o2 - The second Feature
Returns:
A value indicating less than, equal, or greater than.

compareAtts

protected int compareAtts(java.lang.Object att1,
                          java.lang.Object att2)
Compares the two attributes.

Parameters:
att1 - The first attribute to compare.
att2 - The second attribute to compare.
Returns:
A value indicating less than, equal, or greater than.


Copyright © GeoTools. All Rights Reserved.