public class FeatureDictionary extends Object
Constructor and Description |
---|
FeatureDictionary() |
Modifier and Type | Method and Description |
---|---|
void |
addFeature(String name) |
boolean |
equals(Object obj) |
int |
getFeatureIndex(String name)
Returns a unique index for the feature with the given name or -1 if no
such feature exists.
|
String |
getFeatureName(int idx)
Returns the name for the feature with the given index or null if no such
feature is known.
|
SortedMap<String,Integer> |
getIndexMapping()
It is not recommended to work on this datastructure directly! Please use
this only for reading purposes!
|
SortedMap<Integer,String> |
getNameMapping()
It is not recommended to work on this datastructure directly! Please use
this only for reading purposes!
|
int |
getNumberOfFeatures() |
boolean |
hasFeature(String name) |
int |
hashCode() |
void |
load(Reader in)
Loads the content from the given reader to fill this FeatureDictionary.
|
String |
removeFeature(int index)
Removes the feature with the given index and returns its former name.
|
int |
removeFeature(String name)
Removes the feature with the given name and returns its former index.
|
void |
store(Writer out)
Stores this FeatureDictionary to the given Writer.
|
String |
toString() |
public void addFeature(String name)
public boolean hasFeature(String name)
public int getFeatureIndex(String name)
name
- public String getFeatureName(int idx)
idx
- public int removeFeature(String name)
name
- the features name.public String removeFeature(int index)
index
- the features index.public int getNumberOfFeatures()
public SortedMap<String,Integer> getIndexMapping()
public SortedMap<Integer,String> getNameMapping()
public void store(Writer out) throws IOException
out
- a Writer.IOException
public void load(Reader in) throws IOException
in
- a Reader.IOException
Copyright © 2014. All rights reserved.