Class HorizontalPositionsList
- java.lang.Object
-
- org.pentaho.reporting.designer.core.model.HorizontalPositionsList
-
public final class HorizontalPositionsList extends Object
Creation-Date: 26.08.2007, 15:06:45- Author:
- Thomas Morgner
-
-
Constructor Summary
Constructors Constructor Description HorizontalPositionsList()
HorizontalPositionsList(int increment, boolean enableQuickLookup)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(long key, long age)
void
clear()
boolean
containsKey(long key)
void
ensureCapacity(int c)
Ensures, that the list backend can store at leastc
elements.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.long
getAge(long key)
long
getKeyAt(int indexPosition)
long[]
getKeys()
Copys the list contents into a new array.long[]
getKeys(long[] retval)
long
getNext(long key)
long
getPrevious(long key)
Returns the entry that is either equal or less than this key.boolean
isEnableQuickLookup()
boolean
remove(long key)
boolean
removeAll(long age)
Expects a sorted (ascending) list of cut-entries that should be removed.void
setEnableQuickLookup(boolean enableQuickLookup)
int
size()
-
-
-
Method Detail
-
clear
public void clear()
-
isEnableQuickLookup
public boolean isEnableQuickLookup()
-
setEnableQuickLookup
public void setEnableQuickLookup(boolean enableQuickLookup)
-
size
public int size()
-
ensureCapacity
public void ensureCapacity(int c)
Ensures, that the list backend can store at leastc
elements. This method does nothing, if the new capacity is less than the current capacity.- Parameters:
c
- the new capacity of the list.
-
getAge
public long getAge(long key)
-
add
public boolean add(long key, long age)
-
remove
public boolean remove(long key)
-
getNext
public long getNext(long key)
-
getPrevious
public long getPrevious(long key)
Returns the entry that is either equal or less than this key.- Parameters:
key
-- Returns:
-
containsKey
public boolean containsKey(long key)
-
getKeys
public long[] getKeys()
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:
-
getKeyAt
public long getKeyAt(int indexPosition)
-
findKey
public long findKey(long key, boolean upperBounds)
-
removeAll
public boolean removeAll(long age)
Expects a sorted (ascending) list of cut-entries that should be removed. You will run into troubles if the list is not sorted.- Parameters:
age
- the age. All keys with a age smaller than that will be eliminated.- Returns:
- true, if at least one key was removed, false otherwise.
-
-