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
delegate
Constructor and Description |
---|
DisconnectingOutputShop(OutputShop<E> output)
Constructs a disconnecting output shop.
|
Modifier and Type | Method and Description |
---|---|
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.
|
toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
@CreatesObligation public DisconnectingOutputShop(@WillCloseWhenClosed OutputShop<E> output)
output
- the shop to decorate.public 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 Closeable
close
in interface AutoCloseable
close
in class DecoratingOutputShop<E extends Entry,OutputShop<E extends Entry>>
IOException
- on any I/O failure.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 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)
OutputService
getOutputSocket
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()
EntryContainer
getSize
in interface EntryContainer<E extends Entry>
getSize
in class DecoratingEntryContainer<E extends Entry,OutputShop<E extends Entry>>
public boolean isClosed()
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 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–2018 Schlichtherle IT Services. All rights reserved.