Class AArffLoader.AArffReader

  • All Implemented Interfaces:
    weka.core.RevisionHandler
    Enclosing class:
    AArffLoader

    public static class AArffLoader.AArffReader
    extends weka.core.converters.ArffLoader.ArffReader
    • Field Summary

      • Fields inherited from class weka.core.converters.ArffLoader.ArffReader

        m_batchMode, m_Data, m_enclosures, m_fieldSeparator, m_IndicesBuffer, m_Lines, m_retainStringValues, m_stringAttIndices, m_Tokenizer, m_ValueBuffer
    • 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, getAttributeWeight, 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 the getData() 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,
                           boolean batch)
                    throws IOException
        Reads only the header and reserves the specified space for instances. Further instances can be read via readInstance().
        Parameters:
        reader - the reader to use
        capacity - the capacity of the new dataset
        Throws:
        IOException - if something goes wrong
        IllegalArgumentException - 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 the getData() method.
        Parameters:
        reader - the reader to use
        template - the template header
        lines - 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 the readInstance() method.
        Parameters:
        reader - the reader to use
        template - the template header
        lines - the lines read so far
        capacity - 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 the readInstance() method.
        Parameters:
        reader - the reader to use
        template - the template header
        lines - the lines read so far
        capacity - the capacity of the new dataset
        batch - 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 class weka.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 class weka.core.converters.ArffLoader.ArffReader
        Returns:
        true if to retain string values