|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--shared.InstanceReader
Provide a set of functions for reading a list of instances from a source which provides a single instance at a time, attribute by attribute. Supports the exclusion of nominal attributes which have more than a set limit on the number of values.
| Field Summary | |
static int |
mapToLabel
Special value for mapping operations. |
static int |
unmapped
Special value for mapping operations. |
| Constructor Summary | |
InstanceReader(InstanceList ownerList)
Constructor. |
|
InstanceReader(InstanceList ownerList,
int limit)
Constructor. |
|
InstanceReader(InstanceList ownerList,
int limit,
boolean makeUnknown)
Constructor. |
|
InstanceReader(InstanceList ownerList,
int limit,
boolean makeUnknown,
boolean allowUnknownLab)
Constructor. |
|
| Method Summary | |
Instance |
add_instance()
Adds the instance to the list. |
Schema |
get_schema()
Returns the Schema being used to read data. |
boolean |
has_list()
Checks if this InstanceReader has an InstanceList to store Instances in. |
boolean |
is_labelled()
Checks if the Instance being read is labelled. |
void |
match_values(java.lang.String name,
NominalAttrInfo a1,
NominalAttrInfo a2)
Attempts to match values for two fixed value set nominals. |
InstanceList |
release_list()
Releases the list we're building. |
void |
set_from_file(int attrNum,
java.io.BufferedReader dataFile)
Sets the value of an attribute from an MLJ format data file. |
void |
set_from_file(int attrNum,
java.io.StreamTokenizer dataFile)
Sets the value of an attribute from an MLJ format data file. |
void |
set_nominal(int attrNum,
java.lang.String attrVal)
Explicitly sets a nominal value. |
void |
set_real(int attrNum,
double attrVal)
Explicitly sets a real value. |
void |
set_unknown(int attrNum)
Sets an attribute's value to unknown. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
public static final int unmapped
public static final int mapToLabel
| Constructor Detail |
public InstanceReader(InstanceList ownerList)
ownerList - The InstaceList in which Instances will be stored.
public InstanceReader(InstanceList ownerList,
int limit)
ownerList - The InstaceList in which Instances will be stored.limit - The limit number of how many attribute values are possible.
public InstanceReader(InstanceList ownerList,
int limit,
boolean makeUnknown)
ownerList - The InstaceList in which Instances will be stored.limit - The limit number of how many attribute values are possible.makeUnknown - TRUE if unknown values for attributes are possible, FALSE otherwise.
public InstanceReader(InstanceList ownerList,
int limit,
boolean makeUnknown,
boolean allowUnknownLab)
ownerList - The InstaceList in which Instances will be stored.limit - The limit number of how many attribute values are possible.makeUnknown - TRUE if unknown values for attributes are possible, FALSE otherwise.allowUnknownLab - TRUE if unknown labels are possible, FALSE otherwise.| Method Detail |
public void match_values(java.lang.String name,
NominalAttrInfo a1,
NominalAttrInfo a2)
name - The name of the attribute.a1 - The first nominal being compared.a2 - The second nominal being compared.public InstanceList release_list()
public void set_from_file(int attrNum,
java.io.BufferedReader dataFile)
attrNum - The number of the attribute being read.dataFile - The BufferedReader reading the file.
public void set_from_file(int attrNum,
java.io.StreamTokenizer dataFile)
attrNum - The number of the attribute being read.dataFile - The StreamTokenizer reading from the file.public Instance add_instance()
public boolean is_labelled()
public Schema get_schema()
public boolean has_list()
public void set_nominal(int attrNum,
java.lang.String attrVal)
attrNum - The number of the attribute containing the nominal value.attrVal - The value to be set as a nominal value.
public void set_real(int attrNum,
double attrVal)
attrNum - The number of the attribute containing the real value.attrVal - The value to be set as a real value.public void set_unknown(int attrNum)
attrNum - The number of the attribute for which the unknown value will be inserted.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||