JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.table
Class JCCellLayout.Chain

java.lang.Object
  |
  +--com.klg.jclass.table.JCCellLayout.Chain
All Implemented Interfaces:
Serializable
Enclosing class:
JCCellLayout

public class JCCellLayout.Chain
extends Object
implements Serializable

The Chain class encodes a List of row heights or column widths as a sequence of Runs. A Run is a series of items with the same value.

See Also:
Serialized Form

Field Summary
protected  int defaultValue
           
protected  List list
           
 
Constructor Summary
JCCellLayout.Chain()
           
 
Method Summary
 boolean equals(Object o)
           
 int getIndex(int position)
          Returns the index at the given position.
 int getSum(int index)
          Returns the sum of all index's values, up to the index.
 int getValue(int index)
          Returns the value at the index.
 int hashcode()
           
protected  void mergeRuns()
          Walks through the entire list of runs, and coalesces adjacent pairs of runs with the same value into a single run.
 void setValue(int index, int value)
          Sets the value at the index.
 void setValue(int startIndex, int endIndex, int value)
          Sets the value for a range of indexes (inclusive).
protected  void splitLeft(ListIterator iterator, JCCellLayout.Run leftRun, JCCellLayout.Run currentRun, int startIndex, int endIndex, int value)
          Splits a given run into two runs, and adds a run to the right side.
protected  void splitLeftAndRight(ListIterator iterator, JCCellLayout.Run leftRun, JCCellLayout.Run currentRun, int startIndex, int endIndex, int value)
          Splits a given run into three runs, one on either side.
protected  void splitRight(ListIterator iterator, JCCellLayout.Run leftRun, JCCellLayout.Run currentRun, int startIndex, int endIndex, int value)
          Splits a given run into two runs, and adds a run to the right side.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

list

protected List list

defaultValue

protected int defaultValue
Constructor Detail

JCCellLayout.Chain

public JCCellLayout.Chain()
Method Detail

getValue

public int getValue(int index)
Returns the value at the index.

Parameters:
index - The index at whose index the value is required
Returns:
value at the index

getSum

public int getSum(int index)
Returns the sum of all index's values, up to the index.

Parameters:
index - The index up to which to sum
Returns:
sum of all index's values

getIndex

public int getIndex(int position)
Returns the index at the given position.

Parameters:
position - The position at which to determine the index
Returns:
index at the given position

setValue

public void setValue(int index,
                     int value)
Sets the value at the index.

Parameters:
index -
value -

setValue

public void setValue(int startIndex,
                     int endIndex,
                     int value)
Sets the value for a range of indexes (inclusive).

Parameters:
startIndex -
endIndex -
value -

splitLeftAndRight

protected void splitLeftAndRight(ListIterator iterator,
                                 JCCellLayout.Run leftRun,
                                 JCCellLayout.Run currentRun,
                                 int startIndex,
                                 int endIndex,
                                 int value)
Splits a given run into three runs, one on either side.

Parameters:
currentRun -
endIndex -
iterator -
leftRun -
startIndex -
value -

splitLeft

protected void splitLeft(ListIterator iterator,
                         JCCellLayout.Run leftRun,
                         JCCellLayout.Run currentRun,
                         int startIndex,
                         int endIndex,
                         int value)
Splits a given run into two runs, and adds a run to the right side.

Parameters:
currentRun -
endIndex -
iterator -
leftRun -
startIndex -
value -

splitRight

protected void splitRight(ListIterator iterator,
                          JCCellLayout.Run leftRun,
                          JCCellLayout.Run currentRun,
                          int startIndex,
                          int endIndex,
                          int value)
Splits a given run into two runs, and adds a run to the right side.

Parameters:
currentRun -
endIndex -
iterator -
leftRun -
startIndex -
value -

mergeRuns

protected void mergeRuns()
Walks through the entire list of runs, and coalesces adjacent pairs of runs with the same value into a single run.


toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashcode

public int hashcode()

Copyright © 2004 Quest Software Inc..
All rights reserved.