E
- the type of the archive entries.@NotThreadSafe public class MultiplexedOutputShop<E extends MutableEntry> extends DecoratingOutputShop<E,OutputShop<E>>
OutputStream.close()
method.
Note that this implies that the close()
method may fail with
an IOException
.delegate
Constructor and Description |
---|
MultiplexedOutputShop(OutputShop<E> output,
IOPool<?> pool)
Constructs a new multiplexed output shop.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
E |
getEntry(String name)
Returns the entry for the given
name or
null if no entry with this name exists in this container. |
OutputSocket<? extends E> |
getOutputSocket(E local)
Returns an output socket for writing to the given entry.
|
int |
getSize()
Returns the number of entries in this container.
|
boolean |
isBusy()
Returns whether the container output archive is busy writing an archive
entry or not.
|
Iterator<E> |
iterator()
Returns a new iterator for all entries in this container.
|
toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public MultiplexedOutputShop(@WillCloseWhenClosed OutputShop<E> output, IOPool<?> pool)
output
- the decorated output shop.pool
- the pool for buffering entry data.@DischargesObligation public void close() throws IOException
close
in interface OutputShop<E extends MutableEntry>
close
in interface Closeable
close
in interface AutoCloseable
close
in class DecoratingOutputShop<E extends MutableEntry,OutputShop<E extends MutableEntry>>
IOException
@CheckForNull public E getEntry(String name)
EntryContainer
name
or
null
if no entry with this name exists in this container.getEntry
in interface EntryContainer<E extends MutableEntry>
getEntry
in class DecoratingEntryContainer<E extends MutableEntry,OutputShop<E extends MutableEntry>>
name
- an entry name.name
or
null
if no entry with this name exists in this container.public OutputSocket<? extends E> getOutputSocket(E local)
OutputService
getOutputSocket
in interface OutputService<E extends MutableEntry>
getOutputSocket
in class DecoratingOutputShop<E extends MutableEntry,OutputShop<E extends MutableEntry>>
local
- the entry, which will be the
local target
of the returned
output socket.public int getSize()
EntryContainer
getSize
in interface EntryContainer<E extends MutableEntry>
getSize
in class DecoratingEntryContainer<E extends MutableEntry,OutputShop<E extends MutableEntry>>
public boolean isBusy()
public Iterator<E> iterator()
EntryContainer
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.
iterator
in interface EntryContainer<E extends MutableEntry>
iterator
in interface OutputService<E extends MutableEntry>
iterator
in interface Iterable<E extends MutableEntry>
iterator
in class DecoratingEntryContainer<E extends MutableEntry,OutputShop<E extends MutableEntry>>
Copyright © 2005–2018 Schlichtherle IT Services. All rights reserved.