TrueZIP Kernel 7.0-rc1

de.schlichtherle.truezip.entry
Class DecoratingEntryContainer<E extends Entry,C extends EntryContainer<E>>

java.lang.Object
  extended by de.schlichtherle.truezip.entry.DecoratingEntryContainer<E,C>
Type Parameters:
E - The type of the entries.
All Implemented Interfaces:
EntryContainer<E>, Iterable<E>
Direct Known Subclasses:
DecoratingInputShop, DecoratingOutputShop

@ThreadSafe
public abstract class DecoratingEntryContainer<E extends Entry,C extends EntryContainer<E>>
extends Object
implements EntryContainer<E>

An abstract decorator for an entry container.

Author:
Christian Schlichtherle

Field Summary
protected  C delegate
          The decorated entry container.
 
Constructor Summary
protected DecoratingEntryContainer(C container)
          Constructs a new filter entry container.
 
Method Summary
 E getEntry(String name)
          Returns the entry for the given name or null if no entry with this name exists in this container.
 int getSize()
          Returns the number of entries in this container.
 Iterator<E> iterator()
          Returns a new iterator over all entries in this container.
 String toString()
          Returns a string representation of this object for debugging and logging purposes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

delegate

protected final C extends EntryContainer<E> delegate
The decorated entry container.

Constructor Detail

DecoratingEntryContainer

protected DecoratingEntryContainer(C container)
Constructs a new filter entry container.

Parameters:
container - the non-null container to be decorated.
Throws:
NullPointerException - iff container is null.
Method Detail

getSize

public int getSize()
Description copied from interface: EntryContainer
Returns the number of entries in this container.

Specified by:
getSize in interface EntryContainer<E extends Entry>

iterator

public Iterator<E> iterator()
Description copied from interface: EntryContainer
Returns a new iterator over all entries in this 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.

Specified by:
iterator in interface EntryContainer<E extends Entry>
Specified by:
iterator in interface Iterable<E extends Entry>
Returns:
A new non-null iterator over all entries in this container.

getEntry

public E getEntry(String name)
Description copied from interface: EntryContainer
Returns the entry for the given name or null if no entry with this name exists in this container.

Specified by:
getEntry in interface EntryContainer<E extends Entry>
Parameters:
name - an entry name.
Returns:
The entry for the given name or null if no entry with this name exists in this container.

toString

public String toString()
Returns a string representation of this object for debugging and logging purposes.

Overrides:
toString in class Object

TrueZIP Kernel 7.0-rc1

Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.