public interface PrimitiveCollectable<E>
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the collection/map of all elements (optional operation).
|
Object |
clone()
Clones the object, returning an independent copy.
|
boolean |
isEmpty()
Checks whether the collection/map currently has no elements.
|
boolean |
isModifiable()
Checks whether the collection/map can currently be modified.
|
void |
optimize()
Optimizes the implementation after initialization.
|
int |
size()
Gets the number of elements in this collection/map.
|
int size()
If this collection contains more than Integer.MAX_VALUE
elements, Integer.MAX_VALUE
is returned.
boolean isEmpty()
true
if has a size of zerovoid optimize()
The exact nature of the optimization is undefined and is implementation specific. A standard optimization is to trim the internal storage array to the size. An implementation may choose to do nothing, but it should NOT throw an UnsupportedOperationException.
boolean isModifiable()
true
if the collection/map allows some kind of modificationObject clone()
If the implementation is immutable, the object may be returned unaltered.
void clear()
The collection/map will have a zero size after this method completes. This method is optional, throwing an UnsupportedOperationException if the collection/map cannot be cleared.
UnsupportedOperationException
- if method not supported by this collectionCopyright © 2005-2012 Joda.org. All Rights Reserved.