net.sourceforge.cilib.problem.dataset
Class DataSet

java.lang.Object
  extended by net.sourceforge.cilib.problem.dataset.DataSet
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
LocalDataSet

public abstract class DataSet
extends Object
implements Cloneable, Serializable

This interface provides an abstraction for accessing data sets. The underlying data set can be accessed using either an InputStream or a byte[]

Author:
Edwin Peer, Theuns Cloete
See Also:
Serialized Form

Field Summary
protected  String patternExpression
          Deprecated. 
 
Constructor Summary
DataSet()
           
DataSet(DataSet rhs)
           
 
Method Summary
abstract  DataSet getClone()
          Create a cloned copy of the current object and return it.
abstract  byte[] getData()
          Returns the data set as a byte array.
abstract  InputStream getInputStream()
          Returns the data set as an input stream.
 String getPatternExpression()
          Get the regular expression that has been set for this DataSet.
 void setPatternExpression(String regexp)
          Set the regular expression that will be used to split the patterns in the provided DataSet file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

patternExpression

@Deprecated
protected String patternExpression
Deprecated. 
Constructor Detail

DataSet

public DataSet()

DataSet

public DataSet(DataSet rhs)
Method Detail

getClone

public abstract DataSet getClone()
Description copied from interface: Cloneable
Create a cloned copy of the current object and return it. In general the created copy will be a deep copy of the provided instance. As a result this operation an be quite expensive if used incorrectly.

Specified by:
getClone in interface Cloneable
Returns:
An exact clone of the current object instance.
See Also:
Object.clone()

getData

public abstract byte[] getData()
Returns the data set as a byte array.

Returns:
the data set as a byte[]

getInputStream

public abstract InputStream getInputStream()
Returns the data set as an input stream.

Returns:
the data set as a InputStream

setPatternExpression

public void setPatternExpression(String regexp)
Set the regular expression that will be used to split the patterns in the provided DataSet file. The format of this regular expression depends on where you are calling the method from. When you specify the regular expression in a simulation XML file, the format should be a standard regular expression. When you call this method directly with a regular expression in double quotes (from a Java source file), then the format of the regular expression should be a Java style regular expression.

Parameters:
regexp - The regex to use

getPatternExpression

public String getPatternExpression()
Get the regular expression that has been set for this DataSet.

Returns:
The regular expression.


Copyright © 2009 CIRG. All Rights Reserved.