|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.espertech.esper.collection.ArrayBackedCollection<T>
public class ArrayBackedCollection<T>
A fast collection backed by an array with severe limitations. Allows direct access to the backing array - this must be used with care as old elements could be in the array and the array is only valid until the number of elements indicated by size.
Implements only the add, size and clear methods of the collection interface.
When running out of space for the underlying array, allocates a new array of double the size of the current array.
Not synchronized and not thread-safe.
Nested Class Summary | |
---|---|
class |
ArrayBackedCollection.ArrayBackedCollectionIterator
|
Constructor Summary | |
---|---|
ArrayBackedCollection(int currentSize)
Ctor. |
Method Summary | ||
---|---|---|
boolean |
add(T object)
|
|
boolean |
addAll(java.util.Collection c)
|
|
void |
clear()
|
|
boolean |
contains(java.lang.Object o)
|
|
boolean |
containsAll(java.util.Collection c)
|
|
java.lang.Object[] |
getArray()
Returns the backing object array, valid until the current size. |
|
boolean |
isEmpty()
|
|
java.util.Iterator<T> |
iterator()
|
|
boolean |
remove(java.lang.Object o)
|
|
boolean |
removeAll(java.util.Collection c)
|
|
boolean |
retainAll(java.util.Collection c)
|
|
int |
size()
|
|
java.lang.Object[] |
toArray()
|
|
|
toArray(T[] a)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Collection |
---|
equals, hashCode |
Constructor Detail |
---|
public ArrayBackedCollection(int currentSize)
currentSize
- is the initial size of the backing array.Method Detail |
---|
public boolean add(T object)
add
in interface java.util.Collection<T>
public void clear()
clear
in interface java.util.Collection<T>
public int size()
size
in interface java.util.Collection<T>
public java.lang.Object[] getArray()
Applications must ensure to not read past current size as old elements can be encountered.
public boolean isEmpty()
isEmpty
in interface java.util.Collection<T>
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection<T>
public java.util.Iterator<T> iterator()
iterator
in interface java.lang.Iterable<T>
iterator
in interface java.util.Collection<T>
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection<T>
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection<T>
public boolean addAll(java.util.Collection c)
addAll
in interface java.util.Collection<T>
public boolean retainAll(java.util.Collection c)
retainAll
in interface java.util.Collection<T>
public boolean removeAll(java.util.Collection c)
removeAll
in interface java.util.Collection<T>
public boolean containsAll(java.util.Collection c)
containsAll
in interface java.util.Collection<T>
public <T> T[] toArray(T[] a)
toArray
in interface java.util.Collection<T>
|
© 2006-2015 EsperTech Inc. All rights reserved. Visit us at espertech.com |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |