MOA 12.03
Real Time Analytics for Data Streams
moa.streams.ArffFileStream Class Reference

Stream reader of ARFF files. More...

Inheritance diagram for moa.streams.ArffFileStream:
Collaboration diagram for moa.streams.ArffFileStream:

List of all members.

Public Member Functions

String getPurposeString ()
 Gets the purpose of this object.
 ArffFileStream ()
 ArffFileStream (String arffFileName, int classIndex)
void prepareForUseImpl (TaskMonitor monitor, ObjectRepository repository)
 This method describes the implementation of how to prepare this object for use.
InstancesHeader getHeader ()
 Gets the header of this stream.
long estimatedRemainingInstances ()
 Gets the estimated number of remaining instances in this stream.
boolean hasMoreInstances ()
 Gets whether this stream has more instances to output.
Instance nextInstance ()
 Gets the next instance from this stream.
boolean isRestartable ()
 Gets whether this stream can restart.
void restart ()
 Restarts this stream.
void getDescription (StringBuilder sb, int indent)
 Returns a string representation of this object.

Public Attributes

FileOption arffFileOption
IntOption classIndexOption

Protected Member Functions

boolean readNextInstanceFromFile ()

Protected Attributes

Instances instances
Reader fileReader
boolean hitEndOfFile
Instance lastInstanceRead
int numInstancesRead
InputStreamProgressMonitor fileProgressMonitor

Detailed Description

Stream reader of ARFF files.

Author:
Richard Kirkby (rkirkby@cs.waikato.ac.nz)
Version:
Revision:
7

Definition at line 46 of file ArffFileStream.java.


Constructor & Destructor Documentation

moa.streams.ArffFileStream.ArffFileStream ( )

Definition at line 77 of file ArffFileStream.java.

moa.streams.ArffFileStream.ArffFileStream ( String  arffFileName,
int  classIndex 
)

Definition at line 80 of file ArffFileStream.java.

Here is the call graph for this function:


Member Function Documentation

long moa.streams.ArffFileStream.estimatedRemainingInstances ( )

Gets the estimated number of remaining instances in this stream.

Returns:
the estimated number of instances to get from this stream

Implements moa.streams.InstanceStream.

Definition at line 98 of file ArffFileStream.java.

Here is the call graph for this function:

void moa.streams.ArffFileStream.getDescription ( StringBuilder  sb,
int  indent 
)

Returns a string representation of this object.

Used in AbstractMOAObject.toString to give a string representation of the object.

Parameters:
sbthe stringbuilder to add the description
indentthe number of characters to indent

Implements moa.MOAObject.

Definition at line 168 of file ArffFileStream.java.

InstancesHeader moa.streams.ArffFileStream.getHeader ( )

Gets the header of this stream.

This is useful to know attributes and classes. InstancesHeader is an extension of weka.Instances.

Returns:
the header of this stream

Implements moa.streams.InstanceStream.

Reimplemented in moa.streams.generators.multilabel.MultilabelArffFileStream.

Definition at line 93 of file ArffFileStream.java.

String moa.streams.ArffFileStream.getPurposeString ( )

Gets the purpose of this object.

Returns:
the string with the purpose of this object

Reimplemented from moa.options.AbstractOptionHandler.

Reimplemented in moa.streams.generators.multilabel.MultilabelArffFileStream.

Definition at line 50 of file ArffFileStream.java.

boolean moa.streams.ArffFileStream.hasMoreInstances ( )

Gets whether this stream has more instances to output.

This is useful when reading streams from files.

Returns:
true if this stream has more instances to output

Implements moa.streams.InstanceStream.

Definition at line 107 of file ArffFileStream.java.

boolean moa.streams.ArffFileStream.isRestartable ( )

Gets whether this stream can restart.

Returns:
true if this stream can restart

Implements moa.streams.InstanceStream.

Definition at line 119 of file ArffFileStream.java.

Instance moa.streams.ArffFileStream.nextInstance ( )

Gets the next instance from this stream.

Returns:
the next instance of this stream

Implements moa.streams.InstanceStream.

Definition at line 112 of file ArffFileStream.java.

Here is the call graph for this function:

void moa.streams.ArffFileStream.prepareForUseImpl ( TaskMonitor  monitor,
ObjectRepository  repository 
) [virtual]

This method describes the implementation of how to prepare this object for use.

All classes that extends this class have to implement prepareForUseImpl and not prepareForUse since prepareForUse calls prepareForUseImpl.

Parameters:
monitorthe TaskMonitor to use
repositorythe ObjectRepository to use

Implements moa.options.AbstractOptionHandler.

Definition at line 87 of file ArffFileStream.java.

Here is the call graph for this function:

boolean moa.streams.ArffFileStream.readNextInstanceFromFile ( ) [protected]

Definition at line 148 of file ArffFileStream.java.

Referenced by moa.streams.ArffFileStream.nextInstance(), and moa.streams.ArffFileStream.restart().

Here is the caller graph for this function:

void moa.streams.ArffFileStream.restart ( )

Restarts this stream.

It must be similar to starting a new stream from scratch.

Implements moa.streams.InstanceStream.

Definition at line 124 of file ArffFileStream.java.

Referenced by moa.streams.ArffFileStream.ArffFileStream(), moa.streams.generators.multilabel.MultilabelArffFileStream.MultilabelArffFileStream(), and moa.streams.ArffFileStream.prepareForUseImpl().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Initial value:
 new IntOption(
            "classIndex",
            'c',
            "Class index of data. 0 for none or -1 for last attribute in file.",
            -1, -1, Integer.MAX_VALUE)

Definition at line 59 of file ArffFileStream.java.

Referenced by moa.streams.ArffFileStream.ArffFileStream(), and moa.streams.ArffFileStream.restart().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations