sg.edu.nus.comp.nlp.ims.instance
Interface IInstance

All Superinterfaces:
java.lang.Cloneable, java.io.Serializable
All Known Implementing Classes:
CInstance

public interface IInstance
extends java.lang.Cloneable, java.io.Serializable

instance interface.

Author:
zhongzhi

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_Name)
          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_Index)
          get the feature value of feature of p_Index
 java.lang.String getFeatureValue(java.lang.String p_Name)
          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
 

Method Detail

addFeature

boolean addFeature(IFeature p_Feature)
add one feature to the instance. if the feature(identified by its key) has already been set, the old one will be replaced.

Parameters:
p_Feature - feature
Returns:
add success or not

size

int size()
the the number of features in this instance

Returns:
feature size

getFeature

IFeature getFeature(java.lang.String p_Name)
get the feature of this instance with p_Name

Parameters:
p_Name - feature name
Returns:
feature

getFeature

IFeature getFeature(int p_Index)
get the feature of index p_Index

Parameters:
p_Index - feature index
Returns:
feature

getFeatureValue

java.lang.String getFeatureValue(int p_Index)
get the feature value of feature of p_Index

Parameters:
p_Index - feature index
Returns:
feature value

getFeatureValue

java.lang.String getFeatureValue(java.lang.String p_Name)
get the feature value of feature of p_Name

Parameters:
p_Name - feature name
Returns:
feature value

getFeatureName

java.lang.String getFeatureName(int p_Index)
get the name of feature of p_Index

Parameters:
p_Index - feature index
Returns:
feature name

getID

java.lang.String getID()
get the ID of this instance

Returns:
instance ID

getDocID

java.lang.String getDocID()
get the document ID of this instance

Returns:
document id

getLexeltID

java.lang.String getLexeltID()
get the lexelt ID of this instance

Returns:
lexelt ID

getTag

java.util.ArrayList<java.lang.String> getTag()
get tag(s) of this instance

Returns:
tags

setTag

boolean setTag(java.lang.String p_Tag)
add p_Tag to tag list

Parameters:
p_Tag - tag
Returns:
success or not

setTag

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

Parameters:
p_Tag - tag
p_Add - append or replace
Returns:
success or not

setLexeltID

boolean setLexeltID(java.lang.String p_LexeltID)
set lexelt ID

Parameters:
p_LexeltID - lexelt ID
Returns:
set success or not

setDocID

boolean setDocID(java.lang.String p_DocID)
set document ID

Parameters:
p_DocID - document ID
Returns:
success or not

clone

java.lang.Object clone()
clone instance

Returns:
clone instance