E - the type of the entries.@NotThreadSafe public class DisconnectingOutputShop<E extends Entry> extends DecoratingOutputShop<E,OutputShop<E>>
getOutputSocket(E)
and all close() methods, will throw an
OutputClosedException when called.DisconnectingInputShop| Modifier and Type | Class and Description |
|---|---|
private class |
DisconnectingOutputShop.DisconnectingOutputStream |
private class |
DisconnectingOutputShop.DisconnectingSeekableByteChannel |
private class |
DisconnectingOutputShop.Nio2Output |
private class |
DisconnectingOutputShop.Output |
private static class |
DisconnectingOutputShop.SocketFactory |
| Modifier and Type | Field and Description |
|---|---|
private boolean |
closed |
private static DisconnectingOutputShop.SocketFactory |
SOCKET_FACTORY |
delegate| Constructor and Description |
|---|
DisconnectingOutputShop(OutputShop<E> output)
Constructs a disconnecting output shop.
|
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
assertOpen() |
(package private) void |
checkOpen() |
void |
close()
Closes this output shop.
|
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 entry)
Returns an output socket for writing to the given entry.
|
int |
getSize()
Returns the number of entries in this container.
|
boolean |
isClosed() |
Iterator<E> |
iterator()
Returns a new iterator for all entries in this container.
|
toStringprivate boolean closed
private static final DisconnectingOutputShop.SocketFactory SOCKET_FACTORY
@CreatesObligation public DisconnectingOutputShop(@WillCloseWhenClosed OutputShop<E> output)
output - the shop to decorate.final void assertOpen()
final void checkOpen()
throws IOException
IOExceptionpublic void close()
throws IOException
OutputClosedException, even if the call to this method fails
with an IOException.close in interface OutputShop<E extends Entry>close in interface Closeableclose in interface AutoCloseableclose in class DecoratingOutputShop<E extends Entry,OutputShop<E extends Entry>>IOException - on any I/O failure.public E getEntry(String name)
EntryContainername or
null if no entry with this name exists in this container.getEntry in interface EntryContainer<E extends Entry>getEntry in class DecoratingEntryContainer<E extends Entry,OutputShop<E extends Entry>>name - an entry name.name or
null if no entry with this name exists in this container.public final OutputSocket<? extends E> getOutputSocket(E entry)
OutputServicegetOutputSocket in interface OutputService<E extends Entry>getOutputSocket in class DecoratingOutputShop<E extends Entry,OutputShop<E extends Entry>>entry - the entry, which will be the
local target of the returned
output socket.public int getSize()
EntryContainergetSize in interface EntryContainer<E extends Entry>getSize in class DecoratingEntryContainer<E extends Entry,OutputShop<E extends Entry>>public boolean isClosed()
public Iterator<E> iterator()
EntryContainerFirst, 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 Entry>iterator in interface OutputService<E extends Entry>iterator in interface Iterable<E extends Entry>iterator in class DecoratingEntryContainer<E extends Entry,OutputShop<E extends Entry>>Copyright © 2005-2012 Schlichtherle IT Services. All Rights Reserved.