public class SimpleFeatureMapImpl extends Object implements FeatureMap, Serializable, Cloneable, ANNIEConstants
Modifier and Type | Field and Description |
---|---|
static ConcurrentHashMap<Object,Object> |
theKeysHere
the static 'all keys' collection
|
ANNOTATION_COREF_FEATURE_NAME, DATE_ANNOTATION_TYPE, DATE_POSTED_ANNOTATION_TYPE, DEFAULT_FILE, DOCUMENT_COREF_FEATURE_NAME, JOB_ID_ANNOTATION_TYPE, LOCATION_ANNOTATION_TYPE, LOOKUP_ANNOTATION_TYPE, LOOKUP_CLASS_FEATURE_NAME, LOOKUP_INSTANCE_FEATURE_NAME, LOOKUP_LANGUAGE_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, PLUGIN_DIR, 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 and Description |
---|
SimpleFeatureMapImpl() |
Modifier and Type | Method and Description |
---|---|
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 |
containsKey(Object key)
return true if the key is in the map
|
boolean |
containsValue(Object value)
return true if the map contains that value
|
Set<Map.Entry<Object,Object>> |
entrySet() |
boolean |
equals(Object o) |
protected void |
fireMapUpdatedEvent() |
Object |
get(Object key)
return the value associated with the key.
|
protected OClass |
getClassForURIOrName(Ontology ontologyLR,
String name)
Look up the given name in the given ontology.
|
protected int |
getSubsumeKey(Object key)
return the index of the key in the map comparing them by reference only.
|
int |
hashCode()
return the hashCode for the map
|
boolean |
isEmpty()
return true if there are no elements in the map
|
Set<Object> |
keySet()
return the set of the keys in the map.
|
Object |
put(Object key,
Object value)
Overriden to fire events, so that the persistent objects
can keep track of what's updated
|
void |
putAll(Map<? extends Object,? extends Object> t)
put all the elements from a map
|
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
|
int |
size()
return the number of elements in the map
|
boolean |
subsumes(FeatureMap aFeatureMap)
Test if this featureMap includes all features from aFeatureMap
However, if aFeatureMap contains a feature whose value is equal to
gate.creole.ANNIEConstants.LOOKUP_CLASS_FEATURE_NAME (which is normally
"class"), then GATE will attempt to match that feature using an ontology
which it will try to retreive from a feature in both the feature map
through which this method is called and in aFeatureMap.
|
boolean |
subsumes(FeatureMap aFeatureMap,
Set<? extends Object> aFeatureNamesSet)
Tests if this featureMap object includes aFeatureMap but only
for the those features present in the aFeatureNamesSet.
|
boolean |
subsumes(Ontology ontologyLR,
FeatureMap aFeatureMap)
Tests if this featureMap object includes aFeatureMap features.
|
String |
toString() |
Collection<Object> |
values()
Not supported.
|
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, putAll, putIfAbsent, remove, replace, replace, replaceAll, size, values
public static transient ConcurrentHashMap<Object,Object> theKeysHere
public boolean subsumes(FeatureMap aFeatureMap)
subsumes
in interface FeatureMap
aFeatureMap
- object which will be included or not in
this FeatureMap obj.If this param is null then it will return true.true
if aFeatureMap is incuded in this obj.
and false
if not.public boolean subsumes(Ontology ontologyLR, FeatureMap aFeatureMap)
class
and (optionally) ontology
features:subsumes
in interface FeatureMap
ontologyLR
- an ontology to be used for the subsumeaFeatureMap
- object which will be included or not in this
FeatureMap obj.true
if this includes aFeatureMap
and false
if not.protected OClass getClassForURIOrName(Ontology ontologyLR, String name)
ontologyLR
- the ontologyname
- the URI or local resource name to look upnull
if no
suitable class could be found.public boolean subsumes(FeatureMap aFeatureMap, Set<? extends Object> aFeatureNamesSet)
subsumes
in interface FeatureMap
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.true
if all features present in the aFeaturesNameSet
from aFeatureMap are included in this obj, or false
otherwise.public Object put(Object key, Object value)
public Object remove(Object key)
public Object clone()
public void removeFeatureMapListener(FeatureMapListener l)
removeFeatureMapListener
in interface FeatureMap
public void addFeatureMapListener(FeatureMapListener l)
addFeatureMapListener
in interface FeatureMap
protected void fireMapUpdatedEvent()
public int size()
public boolean isEmpty()
public Collection<Object> values()
public Set<Object> keySet()
public boolean containsKey(Object key)
containsKey
in interface Map<Object,Object>
public boolean containsValue(Object value)
containsValue
in interface Map<Object,Object>
public Object get(Object key)
protected int getSubsumeKey(Object key)
public int hashCode()
Copyright © 2024 GATE. All rights reserved.