gate.util
Class SimpleFeatureMapImpl

java.lang.Object
  |
  +--gate.util.SimpleMapImpl
        |
        +--gate.util.SimpleFeatureMapImpl
All Implemented Interfaces:
ANNIEConstants, Cloneable, FeatureMap, Map, Serializable

public class SimpleFeatureMapImpl
extends SimpleMapImpl
implements FeatureMap, Serializable, Cloneable, ANNIEConstants

Simple case of features.

See Also:
Serialized Form

Inner classes inherited from class gate.util.SimpleMapImpl
SimpleMapImpl.Entry
 
Inner classes inherited from class java.util.Map
Map.Entry
 
Field Summary
private static boolean DEBUG
          Debug flag
private  Vector mapListeners
           
(package private) static long serialVersionUID
          Freeze the serialization UID.
 
Fields inherited from class gate.util.SimpleMapImpl
capacity, count, nullKey, theKeys, theKeysHere, theValues
 
Fields inherited from interface gate.creole.ANNIEConstants
ANNOTATION_COREF_FEATURE_NAME, DATE_ANNOTATION_TYPE, DOCUMENT_COREF_FEATURE_NAME, LOCATION_ANNOTATION_TYPE, LOOKUP_ANNOTATION_TYPE, LOOKUP_CLASS_FEATURE_NAME, LOOKUP_MAJOR_TYPE_FEATURE_NAME, LOOKUP_MINOR_TYPE_FEATURE_NAME, LOOKUP_ONTOLOGY_FEATURE_NAME, MONEY_ANNOTATION_TYPE, ORGANIZATION_ANNOTATION_TYPE, PERSON_ANNOTATION_TYPE, PERSON_GENDER_FEATURE_NAME, PR_NAMES, SENTENCE_ANNOTATION_TYPE, SPACE_TOKEN_ANNOTATION_TYPE, TOKEN_ANNOTATION_TYPE, TOKEN_CATEGORY_FEATURE_NAME, TOKEN_KIND_FEATURE_NAME, TOKEN_LENGTH_FEATURE_NAME, TOKEN_ORTH_FEATURE_NAME, TOKEN_STRING_FEATURE_NAME
 
Constructor Summary
SimpleFeatureMapImpl()
           
 
Method Summary
 void addFeatureMapListener(FeatureMapListener l)
          Adds a gate listener
 void clear()
          clear the map
 Object clone()
          Create a copy of the map including the data.
 boolean equals(Object o)
           
protected  void fireMapUpdatedEvent()
           
protected  boolean ontologySubsume(String ontoUrl, String value1, String value2)
          ontology enhanced subsume
 Object put(Object key, Object value)
          Overriden to fire events, so that the persistent objects can keep track of what's updated
 Object remove(Object key)
          Overriden to fire events, so that the persistent objects can keep track of what's updated
 void removeFeatureMapListener(FeatureMapListener l)
          Removes a gate listener
 boolean subsumes(FeatureMap aFeatureMap)
          Test if this featureMap includes all features from aFeatureMap
 boolean subsumes(FeatureMap aFeatureMap, Set aFeatureNamesSet)
          Tests if this featureMap object includes aFeatureMap but only for the those features present in the aFeatureNamesSet.
 
Methods inherited from class gate.util.SimpleMapImpl
, containsKey, containsValue, entrySet, get, getPostionByKey, getPostionByValue, getSubsumeKey, hashCode, increaseCapacity, isEmpty, keySet, putAll, readObject, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, registerNatives, wait, wait, wait
 
Methods inherited from interface java.util.Map
containsKey, containsValue, entrySet, get, hashCode, isEmpty, keySet, putAll, size, values
 

Field Detail

DEBUG

private static final boolean DEBUG
Debug flag

serialVersionUID

static final long serialVersionUID
Freeze the serialization UID.

mapListeners

private transient Vector mapListeners
Constructor Detail

SimpleFeatureMapImpl

public SimpleFeatureMapImpl()
Method Detail

subsumes

public boolean subsumes(FeatureMap aFeatureMap)
Test if this featureMap includes all features from aFeatureMap
Specified by:
subsumes in interface FeatureMap
Parameters:
aFeatureMap - object which will be included or not in this FeatureMap obj.If this param is null then it will return true.
Returns:
true if aFeatureMap is incuded in this obj. and false if not.

subsumes

public boolean subsumes(FeatureMap aFeatureMap,
                        Set aFeatureNamesSet)
Tests if this featureMap object includes aFeatureMap but only for the those features present in the aFeatureNamesSet.
Specified by:
subsumes in interface FeatureMap
Parameters:
aFeatureMap - which will be included or not in this FeatureMap obj.If this param is null then it will return true.
aFeatureNamesSet - is a set of strings representing the names of the features that would be considered for subsumes. If aFeatureNamesSet is null then subsumes(FeatureMap) will be called.
Returns:
true if all features present in the aFeaturesNameSet from aFeatureMap are included in this obj, or false otherwise.

put

public Object put(Object key,
                  Object value)
Overriden to fire events, so that the persistent objects can keep track of what's updated
Specified by:
put in interface Map
Overrides:
put in class SimpleMapImpl

remove

public Object remove(Object key)
Overriden to fire events, so that the persistent objects can keep track of what's updated
Specified by:
remove in interface Map
Overrides:
remove in class SimpleMapImpl

clear

public void clear()
Description copied from class: SimpleMapImpl
clear the map
Specified by:
clear in interface Map
Overrides:
clear in class SimpleMapImpl

clone

public Object clone()
Description copied from class: SimpleMapImpl
Create a copy of the map including the data.
Overrides:
clone in class SimpleMapImpl

equals

public boolean equals(Object o)
Specified by:
equals in interface Map
Overrides:
equals in class SimpleMapImpl

removeFeatureMapListener

public void removeFeatureMapListener(FeatureMapListener l)
Removes a gate listener
Specified by:
removeFeatureMapListener in interface FeatureMap

addFeatureMapListener

public void addFeatureMapListener(FeatureMapListener l)
Adds a gate listener
Specified by:
addFeatureMapListener in interface FeatureMap

fireMapUpdatedEvent

protected void fireMapUpdatedEvent()
Parameters:
e -  

ontologySubsume

protected boolean ontologySubsume(String ontoUrl,
                                  String value1,
                                  String value2)
ontology enhanced subsume
Parameters:
ontoUrl - the url of the ontology to be used
Returns:
true if value1 subsumes value2 in the specified ontology