E - The type of the mapped archive entries.@NotThreadSafe @DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class) public final class FsCovariantEntry<E extends FsArchiveEntry> extends FsEntry implements Cloneable
archive entries and uses its
key property to determine the archive entry
in the map to which it forwards calls to getEntry(),
Entry.getSize(Size) and Entry.getTime(Access).Entry.Access, Entry.Size, Entry.Type| Modifier and Type | Field and Description |
|---|---|
private Entry.Type |
key |
private EnumMap<Entry.Type,E> |
map |
private LinkedHashSet<String> |
members |
private String |
name |
ALL_ACCESS_SET, ALL_SIZE_SET, ALL_TYPE_SET, DIRECTORY_TYPE_SET, FILE_TYPE_SET, SPECIAL_TYPE_SET, SYMLINK_TYPE_SET, UNKNOWN| Constructor and Description |
|---|
FsCovariantEntry(String path)
Constructs a new covariant file system entry with given path.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(String member)
Adds the given base path to the set of members of this directory
if and only if this covariant file system entry implements a directory.
|
FsCovariantEntry<E> |
clone(FsArchiveDriver<E> driver)
Returns a deep clone of this covariant file system entry.
|
Collection<E> |
getEntries()
A collection of the mapped entries.
|
E |
getEntry()
Returns the archive entry mapped for the
key property. |
E |
getEntry(Entry.Type type)
Returns the entry for the given type.
|
Entry.Type |
getKey()
Returns the type of the file system entry to which calls to
getEntry(), Entry.getSize(Size) and
Entry.getTime(Access) shall get forwarded. |
Set<String> |
getMembers()
Returns a set of the members of this directory or
null if and
only if there is no directory entry mapped. |
String |
getName()
Returns a string representation of the
file system entry name. |
long |
getSize(Entry.Size type)
Returns the size mapped for the
key property. |
long |
getTime(Entry.Access type)
Returns the access time mapped for the
key property. |
Set<Entry.Type> |
getTypes()
A set of the mapped types.
|
boolean |
isType(Entry.Type type)
Returns
true if there is an entry mapped for the given type. |
E |
putEntry(Entry.Type type,
E entry)
Maps the given type to the given entry.
|
boolean |
remove(String member)
Removes the given base path from the set of members of this
directory
if and only if this covariant file system entry implements a directory.
|
E |
removeEntry(Entry.Type type)
Removes the entry for the given type from the map.
|
void |
setKey(Entry.Type type)
Selects the type of the file system entry to which calls to
getEntry(), Entry.getSize(Size) and
Entry.getTime(Access) shall get forwarded. |
@Nullable private Entry.Type key
private EnumMap<Entry.Type,E extends FsArchiveEntry> map
@Nullable private LinkedHashSet<String> members
private final String name
public FsCovariantEntry(String path)
path - the file system path.public boolean add(String member)
member - The base path of the member to add.NullPointerException - if this covariant file system entry does
not implement a directory.public FsCovariantEntry<E> clone(FsArchiveDriver<E> driver)
driver - the archive driver to use for cloning the mapped archive
entries.public Collection<E> getEntries()
@Nullable public E getEntry()
key property.key property.@Nullable public E getEntry(Entry.Type type)
type - the type of the entry to lookup.@Nullable public Entry.Type getKey()
getEntry(), Entry.getSize(Size) and
Entry.getTime(Access) shall get forwarded.
Note that an arbitrary property value may get returned:
The initial value is null and even if it's not null,
no entry of this type needs to be mapped.
getEntry(), Entry.getSize(Size) and
Entry.getTime(Access) shall get forwarded.@Nullable public Set<String> getMembers()
null if and
only if there is no directory entry mapped.
This is a bidirectional view: Any change is reflected in the set and
vice versa.getMembers in class FsEntrynull if and
only if there is no directory entry mapped.public String getName()
FsEntryfile system entry name.getName in interface EntrygetName in class FsEntryfile system entry name.EntryName.create(String)public long getSize(Entry.Size type)
key property.public long getTime(Entry.Access type)
key property.public Set<Entry.Type> getTypes()
public boolean isType(Entry.Type type)
true if there is an entry mapped for the given type.isType in class FsEntrytype - the type to lookup.true if there is an entry mapped for the given type.FsEntry.getTypes()@Nullable public E putEntry(Entry.Type type, E entry)
key property is set to the given
type.type - the type to map.entry - the entry to map.public boolean remove(String member)
member - The base path of the member to remove.NullPointerException - if this covariant file system entry does
not implement a directory.@Nullable public E removeEntry(Entry.Type type)
type - the type to remove.public void setKey(@Nullable Entry.Type type)
getEntry(), Entry.getSize(Size) and
Entry.getTime(Access) shall get forwarded.
If the given type is null or no file system entry of this type
is mappeed, then any subsequent call to these methods will fail with a
NullPointerException.type - the type of the file system entry to which calls to
getEntry(), Entry.getSize(Size) and
Entry.getTime(Access) shall get forwarded.Copyright © 2004-2011 Schlichtherle IT Services. All Rights Reserved.