edu.indiana.iucbrf.feature
Class FeatureMap

java.lang.Object
  extended by edu.indiana.iucbrf.feature.AbstractFeatureCollection
      extended by edu.indiana.iucbrf.feature.FeatureMap
All Implemented Interfaces:
Feature, FeatureCollection, SwingRepresentableWithDomain, SwingRepresentable, java.io.Serializable, java.lang.Comparable
Direct Known Subclasses:
OrderedFeatureMap

public class FeatureMap
extends AbstractFeatureCollection

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class edu.indiana.iucbrf.feature.AbstractFeatureCollection
AbstractFeatureCollection.FeatureCollectionPanel, AbstractFeatureCollection.FeatureCollectionTableModel, AbstractFeatureCollection.Key_KeyText_EntryIterator, AbstractFeatureCollection.KeyTextEntryIterator, AbstractFeatureCollection.Ordered_Key_DescText_EntryIterator
 
Field Summary
protected  java.util.HashMap features
           
 
Fields inherited from class edu.indiana.iucbrf.feature.AbstractFeatureCollection
collectionType, containsEstimates, customTitle, DEFAULT_VARIABLE_TYPE, INSETS_BORDER, isReferenceSolution, keyToConf, listeners
 
Fields inherited from interface edu.indiana.iucbrf.feature.FeatureCollection
PROBLEM_FEATURE_COLLECTION, 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
 
Constructor Summary
protected FeatureMap()
           
  FeatureMap(double[] featureValues, Domain domain, int collectionType)
           
  FeatureMap(DoubleCollection someFeatureValues, Domain domain, int collectionType)
           
  FeatureMap(Feature[] features, Domain domain, int collectionType)
           
  FeatureMap(FeatureKey[] keys, Feature[] features, int collectionType)
           
  FeatureMap(int collectionType)
          Creates a new instance of FeatureMap
  FeatureMap(int collectionType, int initialCapacity)
           
 
Method Summary
protected  void addFeatureImpl(FeatureKey key, Feature feature)
          Add a feature to the collection.
protected  void clearFeaturesImpl()
          Clear all features in this FeatureCollection.
 java.util.Iterator entryIterator()
           
 java.util.Iterator featureIterator()
           
 Feature getFeature(FeatureKey key)
          If the collection does not have a feature for the given key, null is returned.
 java.util.Set getKeySet()
           
 int getTotalFeatureCount()
          Get the number of features in this collection.
 java.lang.Object getValue()
           
protected  void initializeCollection(int initialCapacity)
          Override to construct needed object (may ignore initialCapacity if not applicable)
 java.util.Iterator keyIterator()
           
protected  Feature removeFeatureImpl(FeatureKey key)
          Remove the feature at the given index from this FeatureCollection.
protected  Feature replaceFeatureImpl(FeatureKey key, Feature feature)
          Set the feature at an index in the collection to the given feature.
 void setValue(java.lang.Object new_value)
           
 
Methods inherited from class edu.indiana.iucbrf.feature.AbstractFeatureCollection
addEstimatedFeature, addFeature, addFeatureCollectionListener, adjust, clearAllEstimates, clearEstimate, clearFeatures, clone, commonInit, compareTo, containsEstimates, equals, fireFeatureAdded, fireFeatureChange, fireFeatureRemoved, fireFeatureReplaced, fireFeaturesCleared, getCollectionType, getConfidence, getCustomTitle, getDefaultVariableType, getFeaturesMatching, getIsReferenceSolution, getKnownFeatureCount, getTitle, isDefinitelyKnown, isEstimated, midpoint, removeFeature, removeFeatureCollectionListener, replaceFeature, setConfidence, setCustomTitle, setIsReferenceSolution, toString, toString, toString, toSwing, toSwing, toSwing, toSwing, toSwing
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

features

protected java.util.HashMap features
Constructor Detail

FeatureMap

protected FeatureMap()

FeatureMap

public FeatureMap(int collectionType)
Creates a new instance of FeatureMap


FeatureMap

public FeatureMap(int collectionType,
                  int initialCapacity)

FeatureMap

public FeatureMap(double[] featureValues,
                  Domain domain,
                  int collectionType)

FeatureMap

public FeatureMap(Feature[] features,
                  Domain domain,
                  int collectionType)

FeatureMap

public FeatureMap(FeatureKey[] keys,
                  Feature[] features,
                  int collectionType)

FeatureMap

public FeatureMap(DoubleCollection someFeatureValues,
                  Domain domain,
                  int collectionType)
Method Detail

initializeCollection

protected void initializeCollection(int initialCapacity)
Description copied from class: AbstractFeatureCollection
Override to construct needed object (may ignore initialCapacity if not applicable)

Specified by:
initializeCollection in class AbstractFeatureCollection

addFeatureImpl

protected void addFeatureImpl(FeatureKey key,
                              Feature feature)
Add a feature to the collection. This method assumes that issues such as type checking and event-handling are already taken care of, and the feature merely needs to be added to the collection.

Specified by:
addFeatureImpl in class AbstractFeatureCollection
Parameters:
feature - The feature to add

clearFeaturesImpl

protected void clearFeaturesImpl()
Clear all features in this FeatureCollection. This method assumes that issues such as type checking and event-handling are already taken care of, and the feature merely needs to be added to the collection.

Specified by:
clearFeaturesImpl in class AbstractFeatureCollection

getFeature

public Feature getFeature(FeatureKey key)
Description copied from interface: FeatureCollection
If the collection does not have a feature for the given key, null is returned.


getTotalFeatureCount

public int getTotalFeatureCount()
Get the number of features in this collection.


featureIterator

public java.util.Iterator featureIterator()

keyIterator

public java.util.Iterator keyIterator()

getKeySet

public java.util.Set getKeySet()

entryIterator

public java.util.Iterator entryIterator()

removeFeatureImpl

protected Feature removeFeatureImpl(FeatureKey key)
Remove the feature at the given index from this FeatureCollection. This method assumes that issues such as type checking and event-handling are already taken care of, and the feature merely needs to be added to the collection.

Specified by:
removeFeatureImpl in class AbstractFeatureCollection
Parameters:
index - The index of the feature to be removed.

replaceFeatureImpl

protected Feature replaceFeatureImpl(FeatureKey key,
                                     Feature feature)
Set the feature at an index in the collection to the given feature. This method assumes that issues such as type checking and event-handling are already taken care of, and the feature merely needs to be added to the collection.

Specified by:
replaceFeatureImpl in class AbstractFeatureCollection
Returns:
The old feature value

setValue

public void setValue(java.lang.Object new_value)

getValue

public java.lang.Object getValue()