org.rosuda.ibase
Class SVarSet

java.lang.Object
  extended by org.rosuda.ibase.SVarSet

public class SVarSet
extends java.lang.Object

implements set of variables (aka dataset, used as data source) which consists basically of a set of variables (of class SVar) and a marker (of class SMarker).

Version:
$Id: SVarSet.java 2185 2006-04-05 13:28:42Z wichtreyt $

Field Summary
 int classifierCounter
           
 int globalMisclassVarID
           
 int globalResudialStat1ID
           
 int globalResudialStat2ID
           
protected  SMarker mark
          marker associated with this dataset
protected  java.lang.String name
          dataset name
 int regressionCounter
           
protected  java.util.List vars
          list of SVar objects - the variables
 
Constructor Summary
SVarSet()
          default constructor of empty dataset
 
Method Summary
 int add(SVar v)
          add a new variable to the dataset
 SVar at(int i)
          returns variable object at specified index
 SVar byName(java.lang.String nam)
          returns variable object specified by name
 int count()
          returns number of variables in this dataset
 java.lang.Object data(int col, int row)
          returns data value of a variable specified by variable index and row index
 java.lang.Object data(java.lang.String nam, int row)
          returns data value of a variable specified by name and row index
 java.util.Enumeration elements()
          returns enumeration of all variable objects in this dataset
 boolean Export(java.io.PrintStream p)
           
 boolean Export(java.io.PrintStream p, boolean all)
           
 boolean Export(java.io.PrintStream p, boolean all, int[] vars)
           
 SMarker getMarker()
          returns the marker of this dataset
 java.lang.String getName()
          get dataset name
 int indexOf(java.lang.String nam)
          returns the index of a variable specified by its name
 void insert(int index, SVar v)
          add a new empty variable to the dataset
 void insert(java.lang.String name, int index, SVar v)
           
 boolean insertCaseAt(int index)
          add an empty case to the set
 int length()
           
 void move(int from, int to)
          move a variable's to a new index
 void printSummary()
           
 void remove(int index)
          removes a variable of the dataset at specified index
 boolean removeCaseAt(int index)
          delete a case of the set
 void replace(int i, SVar v)
          repaces a variable at the specified index.
 void setMarker(SMarker m)
          sets the marker for this dataset
 void setName(java.lang.String s)
          set dataset name
 int[] whereis(java.lang.Object o, int c_off, int r_off)
          returns coordiantes where searched Object was found
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vars

protected java.util.List vars
list of SVar objects - the variables


mark

protected SMarker mark
marker associated with this dataset


name

protected java.lang.String name
dataset name


globalMisclassVarID

public int globalMisclassVarID

globalResudialStat1ID

public int globalResudialStat1ID

globalResudialStat2ID

public int globalResudialStat2ID

classifierCounter

public int classifierCounter

regressionCounter

public int regressionCounter
Constructor Detail

SVarSet

public SVarSet()
default constructor of empty dataset

Method Detail

setMarker

public void setMarker(SMarker m)
sets the marker for this dataset

Parameters:
m - marker

getMarker

public SMarker getMarker()
returns the marker of this dataset

Returns:
marker

setName

public void setName(java.lang.String s)
set dataset name

Parameters:
s - name

getName

public java.lang.String getName()
get dataset name

Returns:
dataset name

length

public int length()

add

public int add(SVar v)
add a new variable to the dataset

Parameters:
v - variable
Returns:
index of the newly create variable or <0 if an error occured (-1 on null-problems, -2 if that variable-name already exists)

insert

public void insert(int index,
                   SVar v)
add a new empty variable to the dataset

Parameters:
index - index
size - size of SVar
isnum - numbers
cat - categorical /* added 28.12.03 MH

insert

public void insert(java.lang.String name,
                   int index,
                   SVar v)

move

public void move(int from,
                 int to)
move a variable's to a new index

Parameters:
from - from index
to - to index /* added 24.02.04 MH

remove

public void remove(int index)
removes a variable of the dataset at specified index

Parameters:
index - index

insertCaseAt

public boolean insertCaseAt(int index)
add an empty case to the set

Parameters:
index - index

removeCaseAt

public boolean removeCaseAt(int index)
delete a case of the set

Parameters:
index - index

indexOf

public int indexOf(java.lang.String nam)
returns the index of a variable specified by its name

Parameters:
nam - variable name
Returns:
index of the variable (or -1 if not found)

byName

public SVar byName(java.lang.String nam)
returns variable object specified by name

Parameters:
nam - variable name
Returns:
variable object or null if not found.

at

public SVar at(int i)
returns variable object at specified index

Parameters:
i - index
Returns:
variable object or null if index out of range

replace

public void replace(int i,
                    SVar v)
repaces a variable at the specified index. Use with extreme care! Should be used only in the loading stage before the variable is ever used, in order to provide optimized version of the same variable once the type is known.


data

public java.lang.Object data(java.lang.String nam,
                             int row)
returns data value of a variable specified by name and row index

Parameters:
nam - variable name
row - row index
Returns:
data object (or null if out of range)

data

public java.lang.Object data(int col,
                             int row)
returns data value of a variable specified by variable index and row index

Parameters:
col - variable index
row - row index
Returns:
data object (or null if out of range)

whereis

public int[] whereis(java.lang.Object o,
                     int c_off,
                     int r_off)
returns coordiantes where searched Object was found

Parameters:
o - o Object to search for
c_off - c_off search from this case(x) on
r_off - r_off search from this case(y) on
Returns:
coord coord

elements

public java.util.Enumeration elements()
returns enumeration of all variable objects in this dataset

Returns:
object enumeration (of type SVar)

count

public int count()
returns number of variables in this dataset

Returns:
# of variables

Export

public boolean Export(java.io.PrintStream p,
                      boolean all)

Export

public boolean Export(java.io.PrintStream p)

Export

public boolean Export(java.io.PrintStream p,
                      boolean all,
                      int[] vars)

printSummary

public void printSummary()