edu.indiana.iucbrf.feature
Interface FeatureCollection

All Superinterfaces:
java.lang.Comparable, Feature, SwingRepresentable, SwingRepresentableWithDomain
All Known Implementing Classes:
AbstractFeatureCollection, FeatureMap, OrderedFeatureMap

public interface FeatureCollection
extends SwingRepresentableWithDomain, java.lang.Comparable, Feature

A FeatureCollection may be backed by an actual Java Collection, or by any other data type that holds multiple objects, such as a Map. In this interface and subclasses, "collection" refers to any such multiple-object container.


Field Summary
static int PROBLEM_FEATURE_COLLECTION
           
static int SOLUTION_FEATURE_COLLECTION
           
 
Fields inherited from interface edu.indiana.util.swing.SwingRepresentable
TITLE_FONT
 
Fields inherited from interface edu.indiana.iucbrf.feature.Feature
DEFAULT_FEATURE_DIFFERENTIATORS_BY_VARTYPE, FEATURE_VALUE_FONT, INTERVAL_VARIABLE, LABEL_WIDTH, NOMINAL_VARIABLE, ORDINAL_VARIABLE, OTHER_VARIABLE
 
Fields inherited from interface edu.indiana.util.swing.SwingRepresentable
TITLE_FONT
 
Method Summary
 void addEstimatedFeature(FeatureKey featureKey, Feature additional_feature, double confidence, Domain domain)
          Add an estimated feature to this FeatureCollection.
 void addFeature(FeatureKey featureKey, Feature additional_feature, Domain domain)
          Add a feature to this FeatureCollection.
 void addFeatureCollectionListener(FeatureCollectionListener cll)
           
 void clearAllEstimates()
          Remove all estimated features from this collection.
 void clearEstimate(FeatureKey key)
          Remove the given estimated feature from this collection.
 void clearFeatures()
          Clear all features in this FeatureCollection.
 boolean containsEstimates()
           
 java.util.Iterator entryIterator()
           
 boolean equals(java.lang.Object otherFeatureCollection)
           
 java.util.Iterator featureIterator()
           
 int getCollectionType()
           
 double getConfidence(FeatureKey key)
          Get the confidence in the value of a feature.
 java.lang.String getCustomTitle()
           
 Feature getFeature(FeatureKey key)
          If the collection does not have a feature for the given key, null is returned.
 java.util.ArrayList getFeaturesMatching(java.lang.Class feature_class)
          Get the features that are of the given class.
 boolean getIsReferenceSolution()
           
 java.util.Set getKeySet()
           
 int getKnownFeatureCount()
          Get the number of known features in this collection (not including estimated features).
 int getTotalFeatureCount()
          Get the total number of features in this collection (known and estimated).
 boolean isDefinitelyKnown(FeatureKey key)
           
 boolean isEstimated(FeatureKey key)
           
 java.util.Iterator keyIterator()
           
 Feature removeFeature(FeatureKey key)
          Remove the feature at the given index.
 void removeFeatureCollectionListener(FeatureCollectionListener cll)
           
 Feature replaceFeature(FeatureKey key, Feature replacement_feature, Domain domain)
          Replace the feature at the given index with another feature.
 void setCustomTitle(java.lang.String title)
           
 void setIsReferenceSolution(boolean isReferenceSolution)
           
 java.lang.String toString(Domain domain)
           
 
Methods inherited from interface edu.indiana.iucbrf.util.SwingRepresentableWithDomain
toSwing
 
Methods inherited from interface edu.indiana.util.swing.SwingRepresentable
toSwing
 
Methods inherited from interface edu.indiana.iucbrf.feature.Feature
adjust, clone, getDefaultVariableType, getValue, midpoint, setValue, toString, toSwing
 
Methods inherited from interface edu.indiana.util.swing.SwingRepresentable
toSwing
 

Field Detail

PROBLEM_FEATURE_COLLECTION

static final int PROBLEM_FEATURE_COLLECTION
See Also:
Constant Field Values

SOLUTION_FEATURE_COLLECTION

static final int SOLUTION_FEATURE_COLLECTION
See Also:
Constant Field Values
Method Detail

getFeaturesMatching

java.util.ArrayList getFeaturesMatching(java.lang.Class feature_class)
Get the features that are of the given class.

Parameters:
The - class of the features to be obtained.
Returns:
A FeatureCollection of only the features that are of the given class.

addFeature

void addFeature(FeatureKey featureKey,
                Feature additional_feature,
                Domain domain)
Add a feature to this FeatureCollection.

Parameters:
additional_feature - The feature to add.

addEstimatedFeature

void addEstimatedFeature(FeatureKey featureKey,
                         Feature additional_feature,
                         double confidence,
                         Domain domain)
Add an estimated feature to this FeatureCollection.

Parameters:
additional_feature - The feature to add.

replaceFeature

Feature replaceFeature(FeatureKey key,
                       Feature replacement_feature,
                       Domain domain)
Replace the feature at the given index with another feature.

Parameters:
index - The index of the feature to replace.
replacement_feature - The feature to replace the one at the index.

clearFeatures

void clearFeatures()
Clear all features in this FeatureCollection.


removeFeature

Feature removeFeature(FeatureKey key)
Remove the feature at the given index.

Parameters:
key - The key of the feature to remove.

equals

boolean equals(java.lang.Object otherFeatureCollection)
Overrides:
equals in class java.lang.Object

toString

java.lang.String toString(Domain domain)

addFeatureCollectionListener

void addFeatureCollectionListener(FeatureCollectionListener cll)

removeFeatureCollectionListener

void removeFeatureCollectionListener(FeatureCollectionListener cll)

keyIterator

java.util.Iterator keyIterator()

featureIterator

java.util.Iterator featureIterator()

entryIterator

java.util.Iterator entryIterator()

getKeySet

java.util.Set getKeySet()

getFeature

Feature getFeature(FeatureKey key)
If the collection does not have a feature for the given key, null is returned.


getTotalFeatureCount

int getTotalFeatureCount()
Get the total number of features in this collection (known and estimated).


getKnownFeatureCount

int getKnownFeatureCount()
Get the number of known features in this collection (not including estimated features).


getConfidence

double getConfidence(FeatureKey key)
Get the confidence in the value of a feature.

Returns:
c, where c == 1.0 for definitely known (not estimated) features, 0.0 < c < 1.0 for estimated features, and c == 0.0 for unknown and unestimated values.

clearAllEstimates

void clearAllEstimates()
Remove all estimated features from this collection.


clearEstimate

void clearEstimate(FeatureKey key)
Remove the given estimated feature from this collection. Request ignored if the given key does not correspond with an estimated feature.


containsEstimates

boolean containsEstimates()
Returns:
true when the collection contains estimated features, false otherwise.

isDefinitelyKnown

boolean isDefinitelyKnown(FeatureKey key)
Returns:
true if the feature is known, false if estimated or unknown.

isEstimated

boolean isEstimated(FeatureKey key)
Returns:
true if the feature is estimated, false if definitely known or unknown.

getCollectionType

int getCollectionType()

getCustomTitle

java.lang.String getCustomTitle()

setCustomTitle

void setCustomTitle(java.lang.String title)

getIsReferenceSolution

boolean getIsReferenceSolution()

setIsReferenceSolution

void setIsReferenceSolution(boolean isReferenceSolution)