JavaGrinders
Class VariableOrganizer

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector
              extended by JavaGrinders.VariableOrganizer
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess
Direct Known Subclasses:
Group

public class VariableOrganizer
extends java.util.Vector
implements java.lang.Cloneable

coordinates the use of a set of variables that it knows about. It maintains local information about selection states for each row

See Also:
Serialized Form

Field Summary
 java.util.Vector gRowHighlitedState
           
 java.util.Vector gRowMissingState
           
 java.util.Vector gRowSaveSelectedState
           
 java.util.Vector gRowSelectedState
           
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
VariableOrganizer()
          Standard constructor for a VariableOrganizer
VariableOrganizer(DataFileParser aParser)
          Standard constructor for a VariableOrganizer using a DataParser object.
VariableOrganizer(DataFileParser aParser, boolean autoExtract, boolean withTitles)
          Standard constructor for a VariableOrganizer using a DataParser object.
 
Method Summary
 void addSelectRows(Variable partitionVar, java.lang.Object whichValue)
          adds rows that match a given object to the currently selected set of rows
 StrVariable asConcatStrVariable()
          returns a new VariableOrganizer containing all variables which have been selected as independent variables (i.e., VariableDesignRole.X) and all selected rows
 DataTable asDataTable()
          returns a DataTable of doubles for variables in the variableorganizer which have been selected as dependent variables (i.e., VariableDesignRole.Y)
 double[][] asDoubleArray()
          returns a 2D array of doubles for the variables in the variableorganizer which have been selected as dependent variables (i.e., VariableDesignRole.Y) and which are ordinal or nominal
 Matrix asJAMAMatrix()
          returns a matrix for the variables in the variableorganizer which have been selected as dependent variables (i.e., VariableDesignRole.Y) and which are ordinal or nominal
 DataTable asProximity()
          returns a proximity matrix for the variables in the variableorganizer which have been selected as dependent variables (i.e., VariableDesignRole.Y)
 java.lang.String[][] asStringArray()
          returns a 2D array of doubles for the variables in the variableorganizer which have been selected as dependent variables (i.e., VariableDesignRole.Y)
 void asTablePresenter()
          Creates a presenter from a variableorganizer for all the variables the organizer knows about
 VariableOrganizer asVariableOrganizerX()
          returns a new VariableOrganizer containing all variables which have been selected as independent variables (i.e., VariableDesignRole.X) and all selected rows
 VariableOrganizer asVariableOrganizerY()
          returns a new VariableOrganizer containing all variables which have been selected as dependent variables (i.e., VariableDesignRole.Y) and all selected rows
 boolean checkMinVars(int minVars)
          examines whether a minimum number of variables is selected
 boolean checkValidRowRange(int row)
          checks whether a given row is within a valid range
 void clearAllDesignRoles()
          clears all assigned design roles for the variables
 void clearVariableDesignRoles()
          clears the design roles from all columns
 java.lang.Object clone()
          clone the object
 void copySelectStateFrom(Variable aVar)
          sets the select flag for all rows based on select state of another variable
 void deleteCol(int i)
          delete a column from the VariableOrganizer
 void deleteCols()
          delete all columns from the Organizer
 void deleteColsNonX()
          delete all non-X-selected columns from the Organizer
 void deleteColsNonY()
          delete all non-Y-selected columns from the Organizer
 void deleteRow(int row)
          deletes a row from all the variables that are registered with the VariableOrganizer
 void deleteRows()
          deletes all rows from all the variables that are registered with the VariableOrganizer
 void deleteRowsNonSelect()
          delete all non-selected rows from the Organizer
 void deselectAllRows()
          sets the select flag for all rows to false
 void deselectMissingRows()
          unselects all rows if a value is missing in any of the included variables
 int findFirstSelectedRow()
          returns the first selected row of the variable
 int findLastSelectedRow()
          returns the last selected row of the variable
 int findNextNonMissingRow(int startSearchAt)
          returns the next non missing row after a given row
 int findNextSelectedRow(int startSearchAt)
          returns the next selected row after a given row
 int findPreviousSelectedRow(int startSearchAt)
          returns the next lower selected row before a given row
 boolean getDoWarnings()
          sets whether the VariableOrganizer reports warnings
 Variable getFirstXColumn()
          returns the first dependent (X) variable in the VariableOrganizer
 Variable getFirstYColumn()
          returns the first dependent (Y) variable in the VariableOrganizer
 boolean getHighlitedRow(int row)
          returns whether a given row is currently highlited
 boolean getMissingRow(int row)
          returns whether a given row is currently missing.
 int getNextSelectXColumnIndex(int startSearchAt)
          returns the next selected column after a given column
 int getNextSelectYColumnIndex(int startSearchAt)
          returns the next selected column after a given column
 int getNMissingRows()
          returns the number of missing rows in the currently selected set
 int getNRows()
          returns the number of rows for the VariableOrganizer
 int getNSelectRows()
          returns the number of selected rows
 int getNUseRows()
          returns the number of usable rows in the currently selected set
 int getNVariables()
          how many variables are under the control of this VariableOrganizer
 int getNXVariables()
          how many X variables are under the control of this VariableOrganizer
 int getNYVariables()
          how many Y variables are under the control of this VariableOrganizer
 boolean getSelectCell(int col, int row)
          returns whether a given cell of the datamatrix is currently selected
 boolean getSelectRow(int row)
          returns whether a given row is currently selected
 boolean getUseRow(int row)
          returns whether a given row can be used.
 Variable getVariable(int number)
          returns a particular variable designated by a reference number, this corresponds to the zero-based order in which variables were registered with the VariableOrganizer.
 Variable getVariable(java.lang.String variableName)
          returns a particular variable designated by a variable name
 int getVariableDesignRole(int col)
          returns whether a given column is currently chosen as X, Y, label or not selected
 int getVariableIndex(java.lang.String variableName)
          returns the index of a particular variable designated by a variable name
 java.lang.String[] getVariableNames()
          how many Y variables are under the control of this VariableOrganizer
 int getVariablePosition(Variable aVar)
          returns the position in the vector for a particular variable this corresponds to the zero-based order in which variables were registered with the VariableOrganizer.
 DataTable itemsAsDistanceMatrix(int proximitiesType)
          returns a proximity matrix for the variables in the variableorganizer which have been selected as dependent variables (i.e., VariableDesignRole.Y)
 void listDescriptives()
          list descriptives for all Yvariables of the variableorganizer
 void listRows()
          lists all data values in the variable
 void listRows(int startLine, int endLine, boolean selectedOnly)
          lists data values for a range of rows
 void listSelectedRows()
          lists data values for all selected rows in the variable
 void listSelectState()
          lists for each row whether it is selected or not
 void listSelectState(int startLine, int endLine)
          lists for a range of rows whether it is selected or not
 void listVariables()
          lists the Variables registered with the VariableOrganizer
 void moveCol(Variable aVar, int destCol)
          moves a column
 void register(Variable theVariable)
          submit control of the variable to a VariableOrganizer
 void restoreSelectedRows()
          restores the select flag for all rows from a previously saved set
 void restrictToMatchingUseRows()
          restricts to those rows that are usable across the entire VariableOrganizer
 void restrictToMatchingUseRows(Variable aVar)
          restricts to those rows that are usable in this and the other variable
 void restrictToMatchingUseRows(VariableOrganizer aVarOrg)
          restricts the use flag to those rows that are usable in both VariableOrganizers
 void reverseRows(int a1, int a2)
          reverses the values of two given rows
 void saveSelectedRows()
          saves the select flag for all rows
 void selectAbove(Variable partitionVar, double cutoffValue, boolean fromPrevSelected)
          selects all rows that contain a double value above a given double value with the option to select from the previous set
 void selectAllRows()
          sets the select flag for all rows to true
 void selectBelow(Variable partitionVar, double cutoffValue, boolean fromPrevSelected)
          selects all rows that contain a double value below a given double value with the option to select from the previous set
 void selectNonMissingRows()
          restricts use to those rows that are usable across all variables
 void selectRange(Variable partitionVar, double lowValue, double highValue, boolean fromPrevSelected)
          selects all rows that contain a double value between two given double values with the option from the previous set
 void selectRows(int start, int end)
          sets the select flag for all rows to true
 void selectValue(Variable partitionVar, java.lang.Object whichValue, boolean fromPrevSelected)
          selects all rows that match a given value in a given variable with the option to select from the previous set
 void setDoWarnings(boolean doWarnings)
          sets whether the VariableOrganizer reports warnings
 void setHighlitedRow(int row, boolean hil)
          sets the highlited info for a row
 void setMissingRow(int row, boolean missing)
          sets the missing flag for a given row
 void setNRows(int rows)
          sets the number of rows for the VariableOrganizer
 void setSelectRow(int row, boolean sel)
          sets the selection info for a row
 void setVariable(Variable aVar, int index)
          returns a particular variable designated by a reference number, this corresponds to the zero-based order in which variables were registered with the VariableOrganizer.
 void setVariableDesignRole(int col, int designRole)
          sets a design role for a column
 void setVariableDesignRoleForAll(int designRole)
          sets a design role for every column (i.e., X, Y, label or not selected)
 VariableOrganizer sort(int varIndex)
          stacks a number of dependent variables on top of each other, their respective variable names are stored in a second variable
 VariableOrganizer stackYs()
          stacks a number of dependent variables on top of each other, their respective variable names are stored in a second variable
 void subSelectRows(Variable partitionVar, java.lang.Object whichValue)
          deselects rows that match a given object from the currently selected set of rows
 void swapRows(int index1, int index2)
          swaps the values in the two rows of all variables
 void toFile(java.io.BufferedWriter bw)
          writes a variableorganizer into a file writer
 void updateDesignRoleSums()
          updates the design roles for variables
 void updateGlobalMissingRows()
          marks whether any variable has a missing value
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Field Detail

gRowSelectedState

public java.util.Vector gRowSelectedState

gRowMissingState

public java.util.Vector gRowMissingState

gRowHighlitedState

public java.util.Vector gRowHighlitedState

gRowSaveSelectedState

public java.util.Vector gRowSaveSelectedState
Constructor Detail

VariableOrganizer

public VariableOrganizer()
Standard constructor for a VariableOrganizer


VariableOrganizer

public VariableOrganizer(DataFileParser aParser,
                         boolean autoExtract,
                         boolean withTitles)
Standard constructor for a VariableOrganizer using a DataParser object. It automatically tries a best-effort extraction of variables from the DataFileParser

Parameters:
aParser - an instance of DataFileParser class coordinates reading data points from a text file
autoExtract - should variables be extracted automatically?
withTitles - if manually extracted, are titles present?

VariableOrganizer

public VariableOrganizer(DataFileParser aParser)
Standard constructor for a VariableOrganizer using a DataParser object. It automatically tries a best-effort extraction of variables from the DataFileParser

Parameters:
aParser - an instance of DataFileParser class coordinates reading data points from a text file
Method Detail

clone

public java.lang.Object clone()
clone the object

Overrides:
clone in class java.util.Vector

setNRows

public void setNRows(int rows)
sets the number of rows for the VariableOrganizer

Parameters:
rows - number of rows to set

getNRows

public int getNRows()
returns the number of rows for the VariableOrganizer


setDoWarnings

public void setDoWarnings(boolean doWarnings)
sets whether the VariableOrganizer reports warnings


getDoWarnings

public boolean getDoWarnings()
sets whether the VariableOrganizer reports warnings


register

public void register(Variable theVariable)
              throws java.lang.Exception
submit control of the variable to a VariableOrganizer

Parameters:
theVariable - a Variable containing data
Throws:
java.lang.Exception

getVariablePosition

public int getVariablePosition(Variable aVar)
                        throws java.lang.Exception
returns the position in the vector for a particular variable this corresponds to the zero-based order in which variables were registered with the VariableOrganizer.

Parameters:
aVar - the variable to search for
Throws:
java.lang.Exception

setVariable

public void setVariable(Variable aVar,
                        int index)
                 throws java.lang.Exception
returns a particular variable designated by a reference number, this corresponds to the zero-based order in which variables were registered with the VariableOrganizer.

Parameters:
aVar - the variable to store
index - storage number for the variable
Throws:
java.lang.Exception

getVariable

public Variable getVariable(int number)
                     throws java.lang.Exception
returns a particular variable designated by a reference number, this corresponds to the zero-based order in which variables were registered with the VariableOrganizer.

Parameters:
number - storage number for the variable
Throws:
java.lang.Exception

getVariable

public Variable getVariable(java.lang.String variableName)
                     throws java.lang.Exception
returns a particular variable designated by a variable name

Parameters:
variableName - find a variable with this name
Throws:
java.lang.Exception

getVariableIndex

public int getVariableIndex(java.lang.String variableName)
                     throws java.lang.Exception
returns the index of a particular variable designated by a variable name

Parameters:
variableName - find a variable with this name
Throws:
java.lang.Exception

getNVariables

public int getNVariables()
how many variables are under the control of this VariableOrganizer


getNXVariables

public int getNXVariables()
how many X variables are under the control of this VariableOrganizer


getNYVariables

public int getNYVariables()
how many Y variables are under the control of this VariableOrganizer


getVariableNames

public java.lang.String[] getVariableNames()
                                    throws java.lang.Exception
how many Y variables are under the control of this VariableOrganizer

Throws:
java.lang.Exception

updateDesignRoleSums

public void updateDesignRoleSums()
updates the design roles for variables


deleteCol

public void deleteCol(int i)
delete a column from the VariableOrganizer

Parameters:
i - the column to delete

deleteColsNonY

public void deleteColsNonY()
                    throws java.lang.Exception
delete all non-Y-selected columns from the Organizer

Throws:
java.lang.Exception

deleteColsNonX

public void deleteColsNonX()
                    throws java.lang.Exception
delete all non-X-selected columns from the Organizer

Throws:
java.lang.Exception

deleteCols

public void deleteCols()
                throws java.lang.Exception
delete all columns from the Organizer

Throws:
java.lang.Exception

stackYs

public VariableOrganizer stackYs()
                          throws java.lang.Exception
stacks a number of dependent variables on top of each other, their respective variable names are stored in a second variable

Throws:
java.lang.Exception

getNSelectRows

public int getNSelectRows()
                   throws java.lang.Exception
returns the number of selected rows

Throws:
java.lang.Exception

findNextSelectedRow

public int findNextSelectedRow(int startSearchAt)
                        throws java.lang.Exception
returns the next selected row after a given row

Parameters:
startSearchAt - start searching at this row
Throws:
java.lang.Exception

findPreviousSelectedRow

public int findPreviousSelectedRow(int startSearchAt)
                            throws java.lang.Exception
returns the next lower selected row before a given row

Parameters:
startSearchAt - start searching at this row
Throws:
java.lang.Exception

findFirstSelectedRow

public int findFirstSelectedRow()
                         throws java.lang.Exception
returns the first selected row of the variable

Throws:
java.lang.Exception

findLastSelectedRow

public int findLastSelectedRow()
                        throws java.lang.Exception
returns the last selected row of the variable

Throws:
java.lang.Exception

setSelectRow

public void setSelectRow(int row,
                         boolean sel)
                  throws java.lang.Exception
sets the selection info for a row

Parameters:
row - the row to set
sel - selection status for the row
Throws:
java.lang.Exception

getSelectRow

public boolean getSelectRow(int row)
                     throws java.lang.Exception
returns whether a given row is currently selected

Parameters:
row - marks the row in the vector
Throws:
java.lang.Exception

saveSelectedRows

public void saveSelectedRows()
                      throws java.lang.Exception
saves the select flag for all rows

Throws:
java.lang.Exception

restoreSelectedRows

public void restoreSelectedRows()
                         throws java.lang.Exception
restores the select flag for all rows from a previously saved set

Throws:
java.lang.Exception

deleteRow

public void deleteRow(int row)
               throws java.lang.Exception
deletes a row from all the variables that are registered with the VariableOrganizer

Parameters:
row - the row to delete
Throws:
java.lang.Exception

deleteRows

public void deleteRows()
                throws java.lang.Exception
deletes all rows from all the variables that are registered with the VariableOrganizer

Throws:
java.lang.Exception

clearVariableDesignRoles

public void clearVariableDesignRoles()
                              throws java.lang.Exception
clears the design roles from all columns

Throws:
java.lang.Exception

setVariableDesignRoleForAll

public void setVariableDesignRoleForAll(int designRole)
                                 throws java.lang.Exception
sets a design role for every column (i.e., X, Y, label or not selected)

Parameters:
designRole - the design role to set
Throws:
java.lang.Exception

setVariableDesignRole

public void setVariableDesignRole(int col,
                                  int designRole)
                           throws java.lang.Exception
sets a design role for a column

Parameters:
designRole - the design role to set
Throws:
java.lang.Exception

getVariableDesignRole

public int getVariableDesignRole(int col)
returns whether a given column is currently chosen as X, Y, label or not selected

Parameters:
col - marks the column in the vector

clearAllDesignRoles

public void clearAllDesignRoles()
                         throws java.lang.Exception
clears all assigned design roles for the variables

Throws:
java.lang.Exception

moveCol

public void moveCol(Variable aVar,
                    int destCol)
             throws java.lang.Exception
moves a column

Parameters:
aVar - marks the column to move
destCol - marks where the column should be moved to
Throws:
java.lang.Exception

getSelectCell

public boolean getSelectCell(int col,
                             int row)
                      throws java.lang.Exception
returns whether a given cell of the datamatrix is currently selected

Parameters:
col - marks the column in the matrix
row - marks the row in the matrix
Throws:
java.lang.Exception

getFirstXColumn

public Variable getFirstXColumn()
                         throws java.lang.Exception
returns the first dependent (X) variable in the VariableOrganizer

Throws:
java.lang.Exception

getFirstYColumn

public Variable getFirstYColumn()
                         throws java.lang.Exception
returns the first dependent (Y) variable in the VariableOrganizer

Throws:
java.lang.Exception

getNextSelectXColumnIndex

public int getNextSelectXColumnIndex(int startSearchAt)
returns the next selected column after a given column

Parameters:
startSearchAt - start searching at this row

getNextSelectYColumnIndex

public int getNextSelectYColumnIndex(int startSearchAt)
returns the next selected column after a given column

Parameters:
startSearchAt - start searching at this row

findNextNonMissingRow

public int findNextNonMissingRow(int startSearchAt)
                          throws java.lang.Exception
returns the next non missing row after a given row

Parameters:
startSearchAt - start searching at this row
Throws:
java.lang.Exception

selectAllRows

public void selectAllRows()
                   throws java.lang.Exception
sets the select flag for all rows to true

Throws:
java.lang.Exception

selectRows

public void selectRows(int start,
                       int end)
                throws java.lang.Exception
sets the select flag for all rows to true

Throws:
java.lang.Exception

deselectAllRows

public void deselectAllRows()
                     throws java.lang.Exception
sets the select flag for all rows to false

Throws:
java.lang.Exception

setHighlitedRow

public void setHighlitedRow(int row,
                            boolean hil)
                     throws java.lang.Exception
sets the highlited info for a row

Parameters:
row - the row to set
hil - highlited status for the row
Throws:
java.lang.Exception

getHighlitedRow

public boolean getHighlitedRow(int row)
                        throws java.lang.Exception
returns whether a given row is currently highlited

Parameters:
row - marks the row in the vector
Throws:
java.lang.Exception

selectValue

public void selectValue(Variable partitionVar,
                        java.lang.Object whichValue,
                        boolean fromPrevSelected)
                 throws java.lang.Exception
selects all rows that match a given value in a given variable with the option to select from the previous set

Parameters:
partitionVar - the variable to search
whichValue - the object to match
fromPrevSelected - boolean that controls whether the seach applies to the previously selected set only
Throws:
java.lang.Exception

selectAbove

public void selectAbove(Variable partitionVar,
                        double cutoffValue,
                        boolean fromPrevSelected)
                 throws java.lang.Exception
selects all rows that contain a double value above a given double value with the option to select from the previous set

Parameters:
partitionVar - the variable to search
cutoffValue - the double to compare with
fromPrevSelected - boolean that controls whether the seach applies to the previously selected set only
Throws:
java.lang.Exception

selectBelow

public void selectBelow(Variable partitionVar,
                        double cutoffValue,
                        boolean fromPrevSelected)
                 throws java.lang.Exception
selects all rows that contain a double value below a given double value with the option to select from the previous set

Parameters:
partitionVar - the variable to search
cutoffValue - the double to compare with
fromPrevSelected - boolean that controls whether the seach applies to the previously selected set only
Throws:
java.lang.Exception

selectRange

public void selectRange(Variable partitionVar,
                        double lowValue,
                        double highValue,
                        boolean fromPrevSelected)
                 throws java.lang.Exception
selects all rows that contain a double value between two given double values with the option from the previous set

Parameters:
partitionVar - the variable to search
lowValue - the double to compare with
highValue - the double to compare with
fromPrevSelected - boolean that controls whether the seach applies to the previously selected set only
Throws:
java.lang.Exception

addSelectRows

public void addSelectRows(Variable partitionVar,
                          java.lang.Object whichValue)
                   throws java.lang.Exception
adds rows that match a given object to the currently selected set of rows

Parameters:
partitionVar - the variable to search
whichValue - the object to match
Throws:
java.lang.Exception

subSelectRows

public void subSelectRows(Variable partitionVar,
                          java.lang.Object whichValue)
                   throws java.lang.Exception
deselects rows that match a given object from the currently selected set of rows

Parameters:
partitionVar - the variable to search
whichValue - the object to match
Throws:
java.lang.Exception

copySelectStateFrom

public void copySelectStateFrom(Variable aVar)
                         throws java.lang.Exception
sets the select flag for all rows based on select state of another variable

Throws:
java.lang.Exception

getNMissingRows

public int getNMissingRows()
                    throws java.lang.Exception
returns the number of missing rows in the currently selected set

Throws:
java.lang.Exception

setMissingRow

public void setMissingRow(int row,
                          boolean missing)
                   throws java.lang.Exception
sets the missing flag for a given row

Parameters:
row - marks the row in the vector
missing - missing flag for the row
Throws:
java.lang.Exception

getMissingRow

public boolean getMissingRow(int row)
returns whether a given row is currently missing. Returns true if missing or not yet defined.

Parameters:
row - marks the row in the vector

deselectMissingRows

public void deselectMissingRows()
unselects all rows if a value is missing in any of the included variables


getNUseRows

public int getNUseRows()
                throws java.lang.Exception
returns the number of usable rows in the currently selected set

Throws:
java.lang.Exception

getUseRow

public boolean getUseRow(int row)
returns whether a given row can be used. Returns true if not missing and selected.

Parameters:
row - marks the row in the vector

selectNonMissingRows

public void selectNonMissingRows()
                          throws java.lang.Exception
restricts use to those rows that are usable across all variables

Throws:
java.lang.Exception

restrictToMatchingUseRows

public void restrictToMatchingUseRows()
                               throws java.lang.Exception
restricts to those rows that are usable across the entire VariableOrganizer

Throws:
java.lang.Exception

updateGlobalMissingRows

public void updateGlobalMissingRows()
marks whether any variable has a missing value


restrictToMatchingUseRows

public void restrictToMatchingUseRows(Variable aVar)
                               throws java.lang.Exception
restricts to those rows that are usable in this and the other variable

Parameters:
aVar - the other variable
Throws:
java.lang.Exception

restrictToMatchingUseRows

public void restrictToMatchingUseRows(VariableOrganizer aVarOrg)
                               throws java.lang.Exception
restricts the use flag to those rows that are usable in both VariableOrganizers

Parameters:
aVarOrg - the VariableOrganizer
Throws:
java.lang.Exception

swapRows

public void swapRows(int index1,
                     int index2)
              throws java.lang.Exception
swaps the values in the two rows of all variables

Throws:
java.lang.Exception

sort

public VariableOrganizer sort(int varIndex)
                       throws java.lang.Exception
stacks a number of dependent variables on top of each other, their respective variable names are stored in a second variable

Throws:
java.lang.Exception

listVariables

public void listVariables()
lists the Variables registered with the VariableOrganizer


listSelectedRows

public void listSelectedRows()
lists data values for all selected rows in the variable


listSelectState

public void listSelectState()
lists for each row whether it is selected or not


listSelectState

public void listSelectState(int startLine,
                            int endLine)
lists for a range of rows whether it is selected or not

Parameters:
startLine - start listing from this row on
endLine - stop listing at this row

listRows

public void listRows()
lists all data values in the variable


listRows

public void listRows(int startLine,
                     int endLine,
                     boolean selectedOnly)
lists data values for a range of rows

Parameters:
startLine - start listing from this row on
endLine - stop listing at this row
selectedOnly - restrict to selected rows?

listDescriptives

public void listDescriptives()
                      throws java.lang.Exception
list descriptives for all Yvariables of the variableorganizer

Throws:
java.lang.Exception

reverseRows

public void reverseRows(int a1,
                        int a2)
                 throws java.lang.Exception
reverses the values of two given rows

Parameters:
a1 - row one
a2 - row two
Throws:
java.lang.Exception

deleteRowsNonSelect

public void deleteRowsNonSelect()
                         throws java.lang.Exception
delete all non-selected rows from the Organizer

Throws:
java.lang.Exception

asVariableOrganizerY

public VariableOrganizer asVariableOrganizerY()
                                       throws java.lang.Exception
returns a new VariableOrganizer containing all variables which have been selected as dependent variables (i.e., VariableDesignRole.Y) and all selected rows

Throws:
java.lang.Exception

asVariableOrganizerX

public VariableOrganizer asVariableOrganizerX()
                                       throws java.lang.Exception
returns a new VariableOrganizer containing all variables which have been selected as independent variables (i.e., VariableDesignRole.X) and all selected rows

Throws:
java.lang.Exception

asConcatStrVariable

public StrVariable asConcatStrVariable()
                                throws java.lang.Exception
returns a new VariableOrganizer containing all variables which have been selected as independent variables (i.e., VariableDesignRole.X) and all selected rows

Throws:
java.lang.Exception

asDataTable

public DataTable asDataTable()
                      throws java.lang.Exception
returns a DataTable of doubles for variables in the variableorganizer which have been selected as dependent variables (i.e., VariableDesignRole.Y)

Throws:
java.lang.Exception

asDoubleArray

public double[][] asDoubleArray()
                         throws java.lang.Exception
returns a 2D array of doubles for the variables in the variableorganizer which have been selected as dependent variables (i.e., VariableDesignRole.Y) and which are ordinal or nominal

Throws:
java.lang.Exception

asStringArray

public java.lang.String[][] asStringArray()
                                   throws java.lang.Exception
returns a 2D array of doubles for the variables in the variableorganizer which have been selected as dependent variables (i.e., VariableDesignRole.Y)

Throws:
java.lang.Exception

asJAMAMatrix

public Matrix asJAMAMatrix()
                    throws java.lang.Exception
returns a matrix for the variables in the variableorganizer which have been selected as dependent variables (i.e., VariableDesignRole.Y) and which are ordinal or nominal

Throws:
java.lang.Exception

asProximity

public DataTable asProximity()
                      throws java.lang.Exception
returns a proximity matrix for the variables in the variableorganizer which have been selected as dependent variables (i.e., VariableDesignRole.Y)

Throws:
java.lang.Exception

asTablePresenter

public void asTablePresenter()
Creates a presenter from a variableorganizer for all the variables the organizer knows about


toFile

public void toFile(java.io.BufferedWriter bw)
            throws java.lang.Exception
writes a variableorganizer into a file writer

Parameters:
bw - the BufferedWriter to write to
Throws:
java.lang.Exception

checkValidRowRange

public boolean checkValidRowRange(int row)
                           throws java.lang.Exception
checks whether a given row is within a valid range

Parameters:
row - marks the row in the vector
Throws:
java.lang.Exception

checkMinVars

public boolean checkMinVars(int minVars)
                     throws java.lang.Exception
examines whether a minimum number of variables is selected

Parameters:
minVars - the minimum number of variables
Throws:
java.lang.Exception

itemsAsDistanceMatrix

public DataTable itemsAsDistanceMatrix(int proximitiesType)
                                throws java.lang.Exception
returns a proximity matrix for the variables in the variableorganizer which have been selected as dependent variables (i.e., VariableDesignRole.Y)

Throws:
java.lang.Exception