sources
Class OrdinalVariable

java.lang.Object
  extended bysources.Variable
      extended bysources.OrdinalVariable

public class OrdinalVariable
extends Variable

Represents a Ordinal Variable (can be converted into a categorial or continuous Variable!!)


Field Summary
 
Fields inherited from class sources.Variable
id, name
 
Constructor Summary
OrdinalVariable(int[] values, int length, java.lang.String nam, int identnr)
          Creates new OrdinalVariable
 
Method Summary
 CategorialVariable convertToCat()
          converts this variable into a CategorialVariable
 ContinuousVariable convertToCont()
          converts this variable into a ContinuousVariable
static OrdinalVariable createFromCatVar(CategorialVariable catVar)
          creates an OrdinalVariable from a CategorialVariable
 int getCatsAnz()
           
 int getCount()
          returns the number of cases
 int getMaximum()
          returns the maximum value of this variable
 double getMedian()
          returns the median of this variable
 int getMinimum()
          returns the minimum value of this variable
 java.lang.String getTextualRepresentation(int i)
          Returns the textual Representation of this case
 int getValueAt(int i)
          returns the value of case i
 int[] getValues()
          returns all values of this variable
 
Methods inherited from class sources.Variable
equals, getID, getName, getTextualRepresentations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrdinalVariable

public OrdinalVariable(int[] values,
                       int length,
                       java.lang.String nam,
                       int identnr)
Creates new OrdinalVariable

Parameters:
values - values of this variable
length - # cases of this variable
nam - Name of this variable
Method Detail

getCount

public int getCount()
returns the number of cases

Specified by:
getCount in class Variable
Returns:
number of cases

getCatsAnz

public int getCatsAnz()

getTextualRepresentation

public java.lang.String getTextualRepresentation(int i)
Returns the textual Representation of this case

Specified by:
getTextualRepresentation in class Variable
Parameters:
i - case to get the textual representation
Returns:
textual representation

getValueAt

public int getValueAt(int i)
returns the value of case i

Parameters:
i - index of case
Returns:
value of case

getValues

public int[] getValues()
returns all values of this variable

Returns:
values of this variable

createFromCatVar

public static OrdinalVariable createFromCatVar(CategorialVariable catVar)
creates an OrdinalVariable from a CategorialVariable

Parameters:
catVar - the CategorialVariable
Returns:
the OrdinalVariable created from the CategorialVariable

getMinimum

public int getMinimum()
returns the minimum value of this variable

Returns:
the minimum value of this variable

getMaximum

public int getMaximum()
returns the maximum value of this variable

Returns:
the maxumum value of this variable

getMedian

public double getMedian()
returns the median of this variable

Returns:
the median of this variable

convertToCont

public ContinuousVariable convertToCont()
converts this variable into a ContinuousVariable

Returns:
the new created ContinuousVariable

convertToCat

public CategorialVariable convertToCat()
converts this variable into a CategorialVariable

Returns:
the new created CategorialVariable