Package weka.core.converters
Class AArffLoader.AArffReader
- java.lang.Object
-
- weka.core.converters.ArffLoader.ArffReader
-
- weka.core.converters.AArffLoader.AArffReader
-
- All Implemented Interfaces:
weka.core.RevisionHandler
- Enclosing class:
- AArffLoader
public static class AArffLoader.AArffReader extends weka.core.converters.ArffLoader.ArffReader
-
-
Constructor Summary
Constructors Constructor Description AArffReader(Reader reader)
Reads the data completely from the reader.AArffReader(Reader reader, int capacity)
AArffReader(Reader reader, int capacity, boolean batch)
Reads only the header and reserves the specified space for instances.AArffReader(Reader reader, weka.core.Instances template, int lines)
Reads the data without header according to the specified template.AArffReader(Reader reader, weka.core.Instances template, int lines, int capacity)
Initializes the reader without reading the header according to the specified template.AArffReader(Reader reader, weka.core.Instances template, int lines, int capacity, boolean batch)
Initializes the reader without reading the header according to the specified template.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
getRetainStringValues()
Returns whether to retain string values.void
setRetainStringValues(boolean value)
Sets whether to retain string values (safe) or not.-
Methods inherited from class weka.core.converters.ArffLoader.ArffReader
compactify, errorMessage, getData, getFirstToken, getIndex, getInstance, getInstanceFull, getInstanceSparse, getInstanceWeight, getLastToken, getLineNo, getNextToken, getRevision, getStructure, initBuffers, initTokenizer, parseAttribute, readHeader, readInstance, readInstance, readTillEOL
-
-
-
-
Constructor Detail
-
AArffReader
public AArffReader(Reader reader) throws IOException
Reads the data completely from the reader. The data can be accessed via thegetData()
method.- Parameters:
reader
- the reader to use- Throws:
IOException
- if something goes wrong- See Also:
ArffLoader.ArffReader.getData()
-
AArffReader
public AArffReader(Reader reader, int capacity) throws IOException
- Throws:
IOException
-
AArffReader
public AArffReader(Reader reader, int capacity, boolean batch) throws IOException
Reads only the header and reserves the specified space for instances. Further instances can be read viareadInstance()
.- Parameters:
reader
- the reader to usecapacity
- the capacity of the new dataset- Throws:
IOException
- if something goes wrongIllegalArgumentException
- if capacity is negative- See Also:
ArffLoader.ArffReader.getStructure()
,ArffLoader.ArffReader.readInstance(Instances)
-
AArffReader
public AArffReader(Reader reader, weka.core.Instances template, int lines) throws IOException
Reads the data without header according to the specified template. The data can be accessed via thegetData()
method.- Parameters:
reader
- the reader to usetemplate
- the template headerlines
- the lines read so far- Throws:
IOException
- if something goes wrong- See Also:
ArffLoader.ArffReader.getData()
-
AArffReader
public AArffReader(Reader reader, weka.core.Instances template, int lines, int capacity) throws IOException
Initializes the reader without reading the header according to the specified template. The data must be read via thereadInstance()
method.- Parameters:
reader
- the reader to usetemplate
- the template headerlines
- the lines read so farcapacity
- the capacity of the new dataset- Throws:
IOException
- if something goes wrong- See Also:
ArffLoader.ArffReader.getData()
-
AArffReader
public AArffReader(Reader reader, weka.core.Instances template, int lines, int capacity, boolean batch) throws IOException
Initializes the reader without reading the header according to the specified template. The data must be read via thereadInstance()
method.- Parameters:
reader
- the reader to usetemplate
- the template headerlines
- the lines read so farcapacity
- the capacity of the new datasetbatch
- true if the values of string attributes should be collected in the header- Throws:
IOException
- if something goes wrong- See Also:
ArffLoader.ArffReader.getData()
-
-
Method Detail
-
setRetainStringValues
public void setRetainStringValues(boolean value)
Sets whether to retain string values (safe) or not.- Overrides:
setRetainStringValues
in classweka.core.converters.ArffLoader.ArffReader
- Parameters:
value
- true if to retain string values
-
getRetainStringValues
public boolean getRetainStringValues()
Returns whether to retain string values.- Overrides:
getRetainStringValues
in classweka.core.converters.ArffLoader.ArffReader
- Returns:
- true if to retain string values
-
-