com.vividsolutions.jcs.conflate.polygonmatch
Class Matches

java.lang.Object
  extended bycom.vividsolutions.jcs.conflate.polygonmatch.Matches
All Implemented Interfaces:
java.lang.Cloneable, com.vividsolutions.jump.feature.FeatureCollection

public class Matches
extends java.lang.Object
implements com.vividsolutions.jump.feature.FeatureCollection, java.lang.Cloneable

A FeatureCollection that stores the "score" of each Feature. The score is a number between 0.0 and 1.0 that indicates the confidence of a match.


Constructor Summary
Matches(com.vividsolutions.jump.feature.FeatureSchema schema)
          Creates a Matches object.
Matches(com.vividsolutions.jump.feature.FeatureSchema schema, java.util.List features)
          Creates a Matches object, initialized with the given Feature's.
 
Method Summary
 void add(com.vividsolutions.jump.feature.Feature feature)
          This method is not supported, because added features need to be associated with a score.
 void add(com.vividsolutions.jump.feature.Feature feature, double score)
          Adds a match.
 void add(int index, com.vividsolutions.jump.feature.Feature feature)
          This method is not supported, because added features need to be associated with a score.
 void addAll(java.util.Collection features)
          This method is not supported, because added features need to be associated with a score.
 void clear()
          This method is not supported, because Matches should not normally need to have matches removed.
protected  java.lang.Object clone()
           
 com.vividsolutions.jts.geom.Envelope getEnvelope()
           
 com.vividsolutions.jump.feature.Feature getFeature(int index)
           
 java.util.List getFeatures()
           
 com.vividsolutions.jump.feature.FeatureSchema getFeatureSchema()
           
 double getScore(int i)
          Returns the score of the ith feature
 com.vividsolutions.jump.feature.Feature getTopMatch()
           
 double getTopScore()
           
 boolean isEmpty()
           
 java.util.Iterator iterator()
           
 java.util.List query(com.vividsolutions.jts.geom.Envelope envelope)
           
 java.util.Collection remove(com.vividsolutions.jts.geom.Envelope envelope)
          This method is not supported, because Matches should not normally need to have matches removed.
 void remove(com.vividsolutions.jump.feature.Feature feature)
          This method is not supported, because Matches should not normally need to have matches removed.
 void removeAll(java.util.Collection features)
          This method is not supported, because Matches should not normally need to have matches removed.
 int size()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Matches

public Matches(com.vividsolutions.jump.feature.FeatureSchema schema)
Creates a Matches object.

Parameters:
schema - metadata applicable to the features that will be stored in this Matches object

Matches

public Matches(com.vividsolutions.jump.feature.FeatureSchema schema,
               java.util.List features)
Creates a Matches object, initialized with the given Feature's.

Parameters:
schema - metadata applicable to the features that will be stored in this Matches object
features - added to the Matches, each with the max score (1.0)
Method Detail

clone

protected java.lang.Object clone()

add

public void add(com.vividsolutions.jump.feature.Feature feature)
This method is not supported, because added features need to be associated with a score. Use #add(Feature, double) instead.

Specified by:
add in interface com.vividsolutions.jump.feature.FeatureCollection
Parameters:
feature - a feature to add as a match
See Also:
add(Feature, double)

addAll

public void addAll(java.util.Collection features)
This method is not supported, because added features need to be associated with a score. Use #add(Feature, double) instead.

Specified by:
addAll in interface com.vividsolutions.jump.feature.FeatureCollection

add

public void add(int index,
                com.vividsolutions.jump.feature.Feature feature)
This method is not supported, because added features need to be associated with a score. Use #add(Feature, double) instead.

Parameters:
feature - a feature to add as a match
See Also:
add(Feature, double)

remove

public java.util.Collection remove(com.vividsolutions.jts.geom.Envelope envelope)
This method is not supported, because Matches should not normally need to have matches removed.

Specified by:
remove in interface com.vividsolutions.jump.feature.FeatureCollection

clear

public void clear()
This method is not supported, because Matches should not normally need to have matches removed.

Specified by:
clear in interface com.vividsolutions.jump.feature.FeatureCollection

removeAll

public void removeAll(java.util.Collection features)
This method is not supported, because Matches should not normally need to have matches removed.

Specified by:
removeAll in interface com.vividsolutions.jump.feature.FeatureCollection

remove

public void remove(com.vividsolutions.jump.feature.Feature feature)
This method is not supported, because Matches should not normally need to have matches removed.

Specified by:
remove in interface com.vividsolutions.jump.feature.FeatureCollection
Parameters:
feature - a feature to remove

add

public void add(com.vividsolutions.jump.feature.Feature feature,
                double score)
Adds a match. Features with zero-scores are ignored.

Parameters:
feature - a feature to add as a match
score - the confidence of the match, ranging from 0 to 1

getTopScore

public double getTopScore()

getTopMatch

public com.vividsolutions.jump.feature.Feature getTopMatch()
Returns:
the feature with the highest score

getScore

public double getScore(int i)
Returns the score of the ith feature

Parameters:
i - 0, 1, 2, ...
Returns:
the confidence of the ith match

getFeatureSchema

public com.vividsolutions.jump.feature.FeatureSchema getFeatureSchema()
Specified by:
getFeatureSchema in interface com.vividsolutions.jump.feature.FeatureCollection

getEnvelope

public com.vividsolutions.jts.geom.Envelope getEnvelope()
Specified by:
getEnvelope in interface com.vividsolutions.jump.feature.FeatureCollection

size

public int size()
Specified by:
size in interface com.vividsolutions.jump.feature.FeatureCollection

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface com.vividsolutions.jump.feature.FeatureCollection

getFeature

public com.vividsolutions.jump.feature.Feature getFeature(int index)

getFeatures

public java.util.List getFeatures()
Specified by:
getFeatures in interface com.vividsolutions.jump.feature.FeatureCollection

iterator

public java.util.Iterator iterator()
Specified by:
iterator in interface com.vividsolutions.jump.feature.FeatureCollection

query

public java.util.List query(com.vividsolutions.jts.geom.Envelope envelope)
Specified by:
query in interface com.vividsolutions.jump.feature.FeatureCollection