org.geotools.feature
Class FeatureComparators.Name

Object
  extended by FeatureComparators.Name
All Implemented Interfaces:
Comparator
Enclosing class:
FeatureComparators

public static class FeatureComparators.Name
extends Object
implements Comparator

A Comparator which performs the comparison on attributes with a given name.


Constructor Summary
FeatureComparators.Name(String name)
          Create a new Comparator based on the given index.
 
Method Summary
 int compare(Object o1, Object o2)
          Implementation of Comparator.
protected  int compareAtts(Object att1, Object att2)
          Compares the two attributes.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface Comparator
equals
 

Constructor Detail

FeatureComparators.Name

public FeatureComparators.Name(String name)
Create a new Comparator based on the given index.

Parameters:
name - The attribute name.
Method Detail

compare

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

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

compareAtts

protected int compareAtts(Object att1,
                          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 © 1996-2014 Geotools. All Rights Reserved.