sources
Class Selectioner

java.lang.Object
  extended bysources.Selectioner

public class Selectioner
extends java.lang.Object

Class for selection and sorting


Constructor Summary
Selectioner(int length, LDataSet data)
          Creates new Selectioner
 
Method Summary
 void addSelectionListener(SelectionListener l)
          adds a SelectionListener
 int[] fromorigintosorted(int[] indexes)
          transform values from original to sorted values
 int[] fromsortedtoorigin(int[] indexes)
          transform values from sorted to original values
 void ganf()
          move to the last performed selection
 void gend()
          reset selection
 int getLength()
          returns the length of the Selectioner
 boolean[] getSelected()
          returns all selected cases
 int getSelectedCounts()
          returns the number of selected cases
 int[] getSelectedIndices()
          returns all selected indices
 SortFeld getSortFeld()
          returns the sort array
 SortFeld getSortfeldforVar(int i)
          returns the sortfeld for a specific Variable
 boolean isselected(int index)
          return whether the ith case is selected
static void main(java.lang.String[] args)
          Test main funcion
 void newVariableAdded()
           
 void processAction(java.lang.String action, java.lang.Object[] val1, int[] val2, double[] val3, SelectionListener sel)
          Called if an action was performed
 void redo()
          redo last action
 boolean redoposs()
           
 void removeSelectionListener(SelectionListener l)
          removes a SelectionListener
 void setAllSelected()
           
 void setNonSelected(int index)
          sets a case to be not selected
 void setSelected(int index)
          sets a case to be selected
 void setSelection(boolean[] iss)
          sets the selection to the specified array
 void setSelection(int[] iss)
          sets the selection to the specified array
 void setSortFeld(SortFeld sf)
          sets the sort array
 void sort(Variable v, boolean upwards)
          sort a Variable
 void toggle()
          toggles the selection
 java.lang.String toString()
          retruns a textual Representation of this Selectioner
 void undo()
          undo last action
 boolean undoposs()
           
 void undoupdate3(int index)
          Update if undo action was performed
 void variableRemoved(int index)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Selectioner

public Selectioner(int length,
                   LDataSet data)
Creates new Selectioner

Parameters:
data - the parental LDataSet
length - the length of the selectioner
Method Detail

getSortfeldforVar

public SortFeld getSortfeldforVar(int i)
returns the sortfeld for a specific Variable

Parameters:
i - the index of the variable
Returns:
the sortfeld

newVariableAdded

public void newVariableAdded()

variableRemoved

public void variableRemoved(int index)

isselected

public boolean isselected(int index)
return whether the ith case is selected

Parameters:
index - the index
Returns:
true, if selected

setSelected

public void setSelected(int index)
sets a case to be selected

Parameters:
index - the case to select

setNonSelected

public void setNonSelected(int index)
sets a case to be not selected

Parameters:
index - the case to set not selected

getSelected

public boolean[] getSelected()
returns all selected cases

Returns:
all selected cases, true if case i is selected

getLength

public int getLength()
returns the length of the Selectioner

Returns:
the length of the Selectioner

setSelection

public void setSelection(boolean[] iss)
sets the selection to the specified array

Parameters:
iss - the array that represents selected and deselected cases

setAllSelected

public void setAllSelected()

getSelectedCounts

public int getSelectedCounts()
returns the number of selected cases

Returns:
the number of selected cases

setSelection

public void setSelection(int[] iss)
sets the selection to the specified array

Parameters:
iss - the array that represents selected cases

getSelectedIndices

public int[] getSelectedIndices()
returns all selected indices

Returns:
all selected indices

addSelectionListener

public void addSelectionListener(SelectionListener l)
adds a SelectionListener

Parameters:
l - the SelectionListener

removeSelectionListener

public void removeSelectionListener(SelectionListener l)
removes a SelectionListener

Parameters:
l - the SelectionListener

toString

public java.lang.String toString()
retruns a textual Representation of this Selectioner

Returns:
the textual representation

undoupdate3

public void undoupdate3(int index)
Update if undo action was performed

Parameters:
index - the index of the changed sortfeld

undo

public void undo()
undo last action


redo

public void redo()
redo last action


gend

public void gend()
reset selection


ganf

public void ganf()
move to the last performed selection


toggle

public void toggle()
toggles the selection


sort

public void sort(Variable v,
                 boolean upwards)
sort a Variable

Parameters:
v - the variable to sort for
upwards - true: sort upwards false: sort downwards

setSortFeld

public void setSortFeld(SortFeld sf)
sets the sort array

Parameters:
sf - the sort array

getSortFeld

public SortFeld getSortFeld()
returns the sort array

Returns:
the sort array

main

public static void main(java.lang.String[] args)
Test main funcion

Parameters:
args - args

fromorigintosorted

public int[] fromorigintosorted(int[] indexes)
transform values from original to sorted values

Parameters:
indexes - original values
Returns:
sorted values

fromsortedtoorigin

public int[] fromsortedtoorigin(int[] indexes)
transform values from sorted to original values

Parameters:
indexes - sorted values
Returns:
original values

processAction

public void processAction(java.lang.String action,
                          java.lang.Object[] val1,
                          int[] val2,
                          double[] val3,
                          SelectionListener sel)
Called if an action was performed

Parameters:
action - the String representation of the action
val1 - the Objects that specify the action
val2 - the int values that specify the action
val3 - the double values that specify the action
sel - the source of the action

undoposs

public boolean undoposs()

redoposs

public boolean redoposs()