E - the type of the entries in the decorated container.C - the type of the decorated entry container.public abstract class DecoratingContainer<E extends Entry,C extends Container<E>> extends UniqueObject implements Container<E>
| Modifier and Type | Field and Description |
|---|---|
protected C |
container
The nullable decorated entry container.
|
| Modifier | Constructor and Description |
|---|---|
protected |
DecoratingContainer() |
protected |
DecoratingContainer(C container) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
E |
entry(String name)
Returns the entry for the given
name or null if no entry
with this name exists in this container. |
Iterator<E> |
iterator()
Returns a new iterator for all entries in this container.
|
int |
size()
Returns the number of entries in this container.
|
String |
toString()
Returns a string representation of this object for debugging and logging
purposes.
|
equals, hashCodeprotected DecoratingContainer()
protected DecoratingContainer(C container)
@DischargesObligation
public void close()
throws Exception
@Nullable public E entry(String name)
Containername or null if no entry
with this name exists in this container.public Iterator<E> iterator()
ContainerFirst, the iteration must be consistent: Multiple iterators must iterate the same entries in the same order again unless the set of entries has changed.
Next, the iteration should also reflect the natural order of the entries in this container. For example, if this container represents an archive file, the iteration should reflect the natural order of the entries in the archive file.
public int size()
ContainerCopyright © 2012–2015 Schlichtherle IT Services. All rights reserved.