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()
Closes this stream.
|
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, hashCode
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
protected DecoratingContainer()
protected DecoratingContainer(C container)
@DischargesObligation public void close() throws Exception
Stream
@CheckForNull public E entry(String name)
Container
name
or null
if no entry
with this name exists in this container.public Iterator<E> iterator()
Container
First, 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()
Container
Copyright © 2012–2014 Schlichtherle IT Services. All rights reserved.