org.entityfs.impl.impl.adapter
Class AbstractRWEntityAdapter<T extends FileSystemAdapter,U extends DirectoryAdapter>

java.lang.Object
  extended by org.entityfs.impl.impl.adapter.AbstractRWEntityAdapter<T,U>
All Implemented Interfaces:
EntityAdapter
Direct Known Subclasses:
AbstractRamEntityAdapter

public abstract class AbstractRWEntityAdapter<T extends FileSystemAdapter,U extends DirectoryAdapter>
extends Object


Constructor Summary
protected AbstractRWEntityAdapter(T fsAdapter, U parent, String name)
           
 
Method Summary
 boolean canRead()
          Subclasses may override as needed.
 boolean canWrite()
          Subclasses may override as needed.
 boolean exists()
          Subclasses may override as needed.
 T getFileSystemAdapter()
          Get the FileSystemAdapter for the file system where the entity is.
 String getName()
          Get the name of the entity.
 U getParent()
          Get the parent DirectoryAdapter.
 void init()
          This implementation does nothing.
protected  void setName(String name)
           
protected  void setParent(U parent)
          Set a new parent for the entity adapter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.entityfs.impl.adapter.EntityAdapter
create, delete, getEntityType, getLastModified, rename, setLastModified
 

Constructor Detail

AbstractRWEntityAdapter

protected AbstractRWEntityAdapter(T fsAdapter,
                                  U parent,
                                  String name)
Method Detail

getName

public String getName()
Description copied from interface: EntityAdapter
Get the name of the entity.

Returns:
The entity's name.

setName

protected void setName(String name)

getParent

public U getParent()
Description copied from interface: EntityAdapter
Get the parent DirectoryAdapter.

Returns:
The parent DirectoryAdapter.

setParent

protected void setParent(U parent)
Set a new parent for the entity adapter.

This method does not call ChildRegisteringDirectoryAdapter.registerChild(org.entityfs.impl.adapter.EntityAdapter) on the new parent.

Parameters:
parent -

canWrite

public boolean canWrite()
Subclasses may override as needed.

Returns:
true if the entity can be written to.

init

public void init()
This implementation does nothing. Override if necessary.

Specified by:
init in interface EntityAdapter

getFileSystemAdapter

public T getFileSystemAdapter()
Description copied from interface: EntityAdapter
Get the FileSystemAdapter for the file system where the entity is.

Specified by:
getFileSystemAdapter in interface EntityAdapter
Returns:
The entity adapter's FileSystemAdapter.

exists

public boolean exists()
Subclasses may override as needed.

Specified by:
exists in interface EntityAdapter
Returns:
true if the entity exists.

canRead

public boolean canRead()
Subclasses may override as needed.

Specified by:
canRead in interface EntityAdapter
Returns:
true if the entity can be read.