|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsg.edu.nus.comp.nlp.ims.instance.CInstance
public class CInstance
a common instance.
Field Summary | |
---|---|
protected java.lang.String |
m_DocID
|
protected java.util.ArrayList<IFeature> |
m_Features
|
protected java.lang.String |
m_ID
|
protected java.util.Hashtable<java.lang.String,java.lang.Integer> |
m_KeyMap
|
protected java.util.ArrayList<java.lang.String> |
m_Keys
|
protected java.lang.String |
m_LexeltID
|
protected java.util.ArrayList<java.lang.String> |
m_Tags
|
Constructor Summary | |
---|---|
CInstance(java.lang.String p_InstanceID)
initial with instance id |
|
CInstance(java.lang.String p_InstanceID,
java.lang.String p_LexeltID)
initial with instance id and lexelt id |
|
CInstance(java.lang.String p_InstanceID,
java.lang.String p_LexeltID,
java.lang.String p_DocumentID)
initial with instance id, lexelt id and document id |
Method Summary | |
---|---|
boolean |
addFeature(IFeature p_Feature)
add one feature to the instance. |
java.lang.Object |
clone()
clone instance |
java.lang.String |
getDocID()
get the document ID of this instance |
IFeature |
getFeature(int p_Index)
get the feature of index p_Index |
IFeature |
getFeature(java.lang.String p_Key)
get the feature of this instance with p_Name |
java.lang.String |
getFeatureName(int p_Index)
get the name of feature of p_Index |
java.lang.String |
getFeatureValue(int p_KeyIndex)
get the feature value of feature of p_Index |
java.lang.String |
getFeatureValue(java.lang.String p_Key)
get the feature value of feature of p_Name |
java.lang.String |
getID()
get the ID of this instance |
java.lang.String |
getLexeltID()
get the lexelt ID of this instance |
java.util.ArrayList<java.lang.String> |
getTag()
get tag(s) of this instance |
boolean |
setDocID(java.lang.String p_DocID)
set document ID |
boolean |
setLexeltID(java.lang.String p_LexeltID)
set lexelt ID |
boolean |
setTag(java.lang.String p_Tag)
add p_Tag to tag list |
boolean |
setTag(java.lang.String p_Tag,
boolean p_Add)
add p_Tag to tag list if p_Add == true else remove all tags and set tag as p_Tag |
int |
size()
the the number of features in this instance |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.ArrayList<java.lang.String> m_Keys
protected java.util.Hashtable<java.lang.String,java.lang.Integer> m_KeyMap
protected java.util.ArrayList<IFeature> m_Features
protected java.lang.String m_ID
protected java.lang.String m_DocID
protected java.lang.String m_LexeltID
protected java.util.ArrayList<java.lang.String> m_Tags
Constructor Detail |
---|
public CInstance(java.lang.String p_InstanceID, java.lang.String p_LexeltID)
p_InstanceID
- instance idp_LexeltID
- instance lexelt idpublic CInstance(java.lang.String p_InstanceID, java.lang.String p_LexeltID, java.lang.String p_DocumentID)
p_InstanceID
- instance idp_LexeltID
- instance lexelt idp_DocumentID
- instance document idpublic CInstance(java.lang.String p_InstanceID)
p_InstanceID
- instance idMethod Detail |
---|
public boolean addFeature(IFeature p_Feature)
IInstance
addFeature
in interface IInstance
p_Feature
- feature
public java.util.ArrayList<java.lang.String> getTag()
IInstance
getTag
in interface IInstance
public java.lang.String getID()
IInstance
getID
in interface IInstance
public java.lang.String getDocID()
IInstance
getDocID
in interface IInstance
public java.lang.String getLexeltID()
IInstance
getLexeltID
in interface IInstance
public boolean setDocID(java.lang.String p_DocID)
IInstance
setDocID
in interface IInstance
p_DocID
- document ID
public boolean setLexeltID(java.lang.String p_LexeltID)
IInstance
setLexeltID
in interface IInstance
p_LexeltID
- lexelt ID
public boolean setTag(java.lang.String p_Tag)
IInstance
setTag
in interface IInstance
p_Tag
- tag
public boolean setTag(java.lang.String p_Tag, boolean p_Add)
IInstance
setTag
in interface IInstance
p_Tag
- tagp_Add
- append or replace
public IFeature getFeature(java.lang.String p_Key)
IInstance
getFeature
in interface IInstance
p_Key
- feature name
public IFeature getFeature(int p_Index)
IInstance
getFeature
in interface IInstance
p_Index
- feature index
public java.lang.String getFeatureValue(java.lang.String p_Key)
IInstance
getFeatureValue
in interface IInstance
p_Key
- feature name
public java.lang.String getFeatureValue(int p_KeyIndex)
IInstance
getFeatureValue
in interface IInstance
p_KeyIndex
- feature index
public java.lang.String getFeatureName(int p_Index)
IInstance
getFeatureName
in interface IInstance
p_Index
- feature index
public int size()
IInstance
size
in interface IInstance
public java.lang.Object clone()
IInstance
clone
in interface IInstance
clone
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |