jBNC Toolbox

jbnc.dataset
Class DatasetInt

java.lang.Object
  extended byjbnc.dataset.Dataset
      extended byjbnc.dataset.DatasetInt

public final class DatasetInt
extends Dataset

Represents a data set of discreate values.

Since:
June 1, 1999
Author:
Jarek Sacha
See Also:
NamesReader, DatasetReader

Field Summary
 
Fields inherited from class jbnc.dataset.Dataset
cases, discardIncompleteCases, names
 
Constructor Summary
DatasetInt()
          Default constructor.
DatasetInt(int[][] data, AttributeSpecs[] attributeSpecs)
          Set names to null.
 
Method Summary
 java.lang.Object clone()
          Performs a shallow copy of itself.
 void discardAllOfType(AttributeType type)
          Discards all attributes that match the given type.
 void openC45(java.lang.String namesFile, java.lang.String dataFile)
           
 void saveCasesC45(java.lang.String fileName)
           
 
Methods inherited from class jbnc.dataset.Dataset
clear, getDiscardIncompleteCases, openC45, saveC45, saveC45, saveNamesC45, setDiscardIncompleteCases
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatasetInt

public DatasetInt()
Default constructor.


DatasetInt

public DatasetInt(int[][] data,
                  AttributeSpecs[] attributeSpecs)
           throws java.lang.Exception
Set names to null. Initialize dataset with the array data .

Parameters:
data - Array of cases data[case][variable]
attributeSpecs - Specifications for attributes
Throws:
java.lang.Exception - Description of Exception
Method Detail

openC45

public void openC45(java.lang.String namesFile,
                    java.lang.String dataFile)
             throws java.lang.Exception
Overrides:
openC45 in class Dataset
Parameters:
namesFile -
dataFile -
Throws:
java.lang.Exception

saveCasesC45

public void saveCasesC45(java.lang.String fileName)
                  throws java.lang.Exception
Overrides:
saveCasesC45 in class Dataset
Parameters:
fileName -
Throws:
java.lang.Exception

discardAllOfType

public void discardAllOfType(AttributeType type)
Discards all attributes that match the given type. Removes columns from the data set and entries from the names vector.

Overrides:
discardAllOfType in class Dataset
Parameters:
type - Type of attributes to be discarded.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Performs a shallow copy of itself. Member variables in the clone dataset are references to variables in the parent dataset. Only primitive types members, like boolean, are actually copied.

Overrides:
clone in class Dataset
Returns:
a clone of this dataset.
Throws:
java.lang.CloneNotSupportedException

SourceForge.net Logo