|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Element
Represents an abstract element in a browsable tree, e.g. a file or a directory.
It is strongly recommended to implement equals() and hashCode()
methods, since Elements are actively used in hash containers.
| Method Summary | |
|---|---|
java.lang.Iterable<Element> |
getChildren()
Returns the ordered list of element's children. |
java.lang.String |
getFullName()
Returns the unique full name of the element (from the root). |
java.io.InputStream |
getInputStream()
Returns the input stream of the element content. |
java.lang.String |
getName()
Returns the element's name. |
long |
getSize()
Returns the size of the element content. |
boolean |
isContentAvailable()
Returns whether the content is available for the element. |
boolean |
isLeaf()
Returns whether the element is a leaf, i.e. |
| Method Detail |
|---|
@NotNull java.lang.String getName()
@NotNull java.lang.String getFullName()
boolean isLeaf()
@Nullable java.lang.Iterable<Element> getChildren()
null for a leaf element, and a
not null instance for other elements.
List can be empty. All children's names are different.
boolean isContentAvailable()
getInputStream() method will result in exception.
@NotNull
java.io.InputStream getInputStream()
throws java.lang.IllegalStateException,
java.io.IOException
If the content is not available for the element (see isContentAvailable()), an exception is thrown.
java.lang.IllegalStateException - if the content is not available
java.io.IOException - if the input cannot be provided due to I/O error
long getSize()
throws java.lang.IllegalStateException
If the content is not available for the element (see isContentAvailable()), an exception may be thrown,
or due to performance reasons a negative value may be returned.
Though some implementations can provide the content size, while the content is not available.
java.lang.IllegalStateException - if the content size is not available
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||