org.pentaho.reporting.engine.classic.core.modules.output.table.base
Class TableCutList

java.lang.Object
  extended by org.pentaho.reporting.engine.classic.core.modules.output.table.base.TableCutList

public class TableCutList
extends Object

Creation-Date: 26.08.2007, 15:06:45

Author:
Thomas Morgner

Field Summary
static long bin
           
static long lin
           
 
Constructor Summary
TableCutList(int increment, boolean enableQuickLookup)
           
 
Method Summary
static int binarySearch(long[] array, long key, int start, int end)
           
 boolean containsKey(long key)
           
 long findKey(long key, boolean upperBounds)
           
 int findKeyPosition(long coordinate, boolean greater)
          Tries to locate the key that matches the given key-parameter as closely as possible.
 int findKeyPosition(long coordinate, boolean greater, int lastFoundPos)
           
 Boolean get(long key)
           
 long getKeyAt(int indexPosition)
           
 long[] getKeys()
          Deprecated. Always provide a buffer for performance reasons.
 long[] getKeys(long[] retval)
           
 Boolean getPrevious(long key)
           
 Boolean[] getRawEntries()
           
 Boolean getValueAt(int indexPosition)
           
 boolean isEnableQuickLookup()
           
static int linearSearch(long[] array, long key, int start, int end)
           
 boolean put(long key, Boolean entry)
           
 boolean remove(long key)
           
 void removeAll(long[] cutArray, long cutSize)
          Expects a sorted (ascending) list of cut-entries that should be removed.
 void setEnableQuickLookup(boolean enableQuickLookup)
           
 int size()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bin

public static long bin

lin

public static long lin
Constructor Detail

TableCutList

public TableCutList(int increment,
                    boolean enableQuickLookup)
Method Detail

isEnableQuickLookup

public boolean isEnableQuickLookup()

setEnableQuickLookup

public void setEnableQuickLookup(boolean enableQuickLookup)

size

public int size()

put

public boolean put(long key,
                   Boolean entry)

remove

public boolean remove(long key)

get

public Boolean get(long key)

getPrevious

public Boolean getPrevious(long key)

containsKey

public boolean containsKey(long key)

linearSearch

public static int linearSearch(long[] array,
                               long key,
                               int start,
                               int end)

binarySearch

public static int binarySearch(long[] array,
                               long key,
                               int start,
                               int end)

getRawEntries

public Boolean[] getRawEntries()

getKeys

public long[] getKeys()
Deprecated. Always provide a buffer for performance reasons.

Copys the list contents into a new array.

Returns:
the list contents as array.

getKeys

public long[] getKeys(long[] retval)

findKeyPosition

public int findKeyPosition(long coordinate,
                           boolean greater)
Tries to locate the key that matches the given key-parameter as closely as possible. If greater is set to true, then - if the coordinate is not contained in the list - the next coordinate is given, else the previous one is returned.

Parameters:
coordinate -
greater -
Returns:

findKeyPosition

public int findKeyPosition(long coordinate,
                           boolean greater,
                           int lastFoundPos)

getKeyAt

public long getKeyAt(int indexPosition)

getValueAt

public Boolean getValueAt(int indexPosition)

findKey

public long findKey(long key,
                    boolean upperBounds)

removeAll

public void removeAll(long[] cutArray,
                      long cutSize)
Expects a sorted (ascending) list of cut-entries that should be removed. You will run into troubles if the list is not sorted.

Parameters:
cutArray -