public class SortedRenderableList extends java.lang.Object implements java.util.Collection<GLRenderable>
The zOrder is read from render properties if the GLRenderable is an instance
of HasRenderProps. Otherwise, a zOrder can be specified in
add(GLRenderable,int)
, or is assumed to be 0.
Modifier and Type | Field and Description |
---|---|
static int |
defaultCapacity |
static int |
defaultIncrement |
Constructor and Description |
---|
SortedRenderableList()
Constructs an empty list with an initial capacity of ten.
|
SortedRenderableList(java.util.Collection<? extends GLRenderable> c)
Constructs a set containing the elements of the specified
collection.
|
SortedRenderableList(int initialCapacity)
Constructs an empty list with the specified initial capacity.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(GLRenderable e)
Adds an element to this set, sorted ascending by the zOrder parameter
if exists (otherwise assumed zOrder = 0).
|
boolean |
add(GLRenderable e,
int zOrder)
Adds an element to this set, sorted ascending by the zOrder parameter
if exists.
|
boolean |
addAll(java.util.Collection<? extends GLRenderable> c)
Adds all elements in
c to this set. |
void |
clear()
Clears all elements from this set
|
boolean |
contains(java.lang.Object o)
Determines whether the set contains a specified object
|
boolean |
containsAll(java.util.Collection<?> c)
Returns true if this set contains all elements in the
supplied collection
|
GLRenderable |
first()
Gets the first element in the set
|
GLRenderable |
get(int index) |
boolean |
isEmpty()
Returns true if set is empty
|
java.util.Iterator<GLRenderable> |
iterator()
Returns an iterator for looping through elements
|
GLRenderable |
last()
Gets the last element in the set
|
int |
numSelectionQueriesNeeded()
Returns the maximum number of selection queries required for all
renderables in this list.
|
GLRenderable |
remove(int idx) |
boolean |
remove(java.lang.Object o)
Removes an element from this set
|
boolean |
removeAll(java.util.Collection<?> c)
Removes all elements in this set that are found in
c . |
boolean |
retainAll(java.util.Collection<?> c)
Retains only the elements that are also found in the collection
c , essentially performing an intersection. |
void |
setIncrement(int inc)
Sets the size to grow the array when we read capacity
|
int |
size()
Returns the number of elements in the set
|
GLRenderable[] |
toArray()
Returns a copy of the GLRenderable array
|
<T> T[] |
toArray(T[] a)
Fills an array with the current sorted GLRenderables.
|
public static int defaultCapacity
public static int defaultIncrement
public SortedRenderableList(int initialCapacity)
initialCapacity
- the initial capacity of the listpublic SortedRenderableList()
public SortedRenderableList(java.util.Collection<? extends GLRenderable> c)
c
- the collection whose elements are to be placed into this listjava.lang.NullPointerException
- if the specified collection is nullpublic int numSelectionQueriesNeeded()
public void setIncrement(int inc)
inc
- public int size()
size
in interface java.util.Collection<GLRenderable>
public boolean isEmpty()
isEmpty
in interface java.util.Collection<GLRenderable>
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection<GLRenderable>
public java.util.Iterator<GLRenderable> iterator()
iterator
in interface java.lang.Iterable<GLRenderable>
iterator
in interface java.util.Collection<GLRenderable>
public GLRenderable[] toArray()
toArray
in interface java.util.Collection<GLRenderable>
public <T> T[] toArray(T[] a)
a
' is too small.toArray
in interface java.util.Collection<GLRenderable>
a
- public boolean add(GLRenderable e)
add
in interface java.util.Collection<GLRenderable>
public boolean add(GLRenderable e, int zOrder)
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection<GLRenderable>
public GLRenderable remove(int idx)
public boolean containsAll(java.util.Collection<?> c)
containsAll
in interface java.util.Collection<GLRenderable>
public boolean addAll(java.util.Collection<? extends GLRenderable> c)
c
to this set. Always returns true;addAll
in interface java.util.Collection<GLRenderable>
public boolean retainAll(java.util.Collection<?> c)
c
, essentially performing an intersection. Returns true
if the collection is modifiedretainAll
in interface java.util.Collection<GLRenderable>
public boolean removeAll(java.util.Collection<?> c)
c
. Returns true if the set is modified.removeAll
in interface java.util.Collection<GLRenderable>
public void clear()
clear
in interface java.util.Collection<GLRenderable>
public GLRenderable first()
public GLRenderable last()
public GLRenderable get(int index)