|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectelectric.directory.Directory
Directory is an implementation of IDirectory that uses a Dictionary as its underlying storage. By default, a Directory uses a Hashtable as its underlying Dictionary. The electric.util.dictionary package includes other Dictionary implementations such as PersistentDictionary and TransactionalDictionary.
| Field Summary | |
protected java.util.Dictionary |
dictionary
|
protected IDirectory |
parent
|
| Fields inherited from interface electric.util.log.ILoggingConstants |
CLASSLOADER_EVENT, COMMAND_EVENT, COMMENT_EVENT, CONFIG_EVENT, DEBUG_EVENT, ELECTRIC_LOGGING_PROPERTY, ERROR_EVENT, EXCEPTION_EVENT, FILE_EVENT, LICENSE_EVENT, RESOURCES_EVENT, SECURITY_EVENT, SHUTDOWN_EVENT, SOURCE_EVENT, SQL_EVENT, STARTUP_EVENT, WARNING_EVENT |
| Constructor Summary | |
Directory()
Create an empty Directory with no parent and a Hashtable as its underlying Dictionary. |
|
Directory(java.util.Dictionary dictionary)
Create a Directory with no parent and the specified Dictionary as its underlying storage. |
|
| Method Summary | |
void |
delete()
Delete this directory. |
java.util.Enumeration |
findAll(ISelector selector)
|
java.lang.Object |
findFirst(ISelector selector)
|
java.lang.Object |
get(java.lang.String path)
Return the object associated with the the specified path, or null if not found. |
IDirectory |
getParent()
Return the parent of this directory, or null if there is none. |
protected electric.directory.Parts |
getParts(java.lang.String path,
boolean create)
Return a Parts object that contains a broken down version of the specified path. |
java.lang.String |
getPath(java.lang.Object object)
Return the path of the specified object relative to this container, or null if the object is not found. |
IDirectory |
getRoot()
Return the root of this directory. |
protected IDirectory |
getSubdirectory(java.lang.String name,
boolean create)
Return the subdirectory with the specified name. |
java.util.Enumeration |
keys()
Return an enumeration over all the keys in this directory. |
IDirectory |
newSubdirectory(java.lang.String name)
Create and return a new subdirectory with the specified name. |
java.lang.Object |
peek(java.lang.String path)
Return the object with the specified path, or null if not found. |
java.lang.Object |
put(java.lang.String path,
java.lang.Object object)
Associate an object with the specified path. |
java.lang.Object |
remove(java.lang.String path)
Remove and return the object associate with the specified path, or null if not found. |
boolean |
removeObject(java.lang.Object object)
Remove the specifed object from the directory. |
void |
setParent(IDirectory directory)
Set the parent of this directory. |
int |
size()
Return the number of entries in this directory. |
java.lang.String |
toString()
Return a description of this directory. |
protected java.lang.String |
toString(java.lang.String type)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.util.Dictionary dictionary
protected IDirectory parent
| Constructor Detail |
public Directory()
public Directory(java.util.Dictionary dictionary)
dictionary - The dictionary to use as storage.| Method Detail |
public java.lang.String toString()
protected java.lang.String toString(java.lang.String type)
type -
public java.lang.String getPath(java.lang.Object object)
throws DirectoryException
getPath in interface IContainerobject - The object to find.
DirectoryException - If an internal exception occurs.
public java.lang.Object get(java.lang.String path)
throws DirectoryException
get in interface IDirectorypath - The path.
DirectoryException - If the path is invalid or an exception occurs
in the underlying directory.
public java.lang.Object peek(java.lang.String path)
throws DirectoryException
peek in interface IDirectorypath - The path.
DirectoryException - If an error occurs in the underlying directory.
public java.lang.Object put(java.lang.String path,
java.lang.Object object)
throws DirectoryException
put in interface IDirectorypath - The path.object - The object.
DirectoryException - If the path is invalid or an exception occurs
in the underlying directory.
public java.lang.Object remove(java.lang.String path)
throws DirectoryException
remove in interface IDirectorypath - The path.
DirectoryException - If the path is invalid or an exception occurs
in the underlying directory.public void setParent(IDirectory directory)
setParent in interface IDirectorydirectory - The new parent.public IDirectory getParent()
getParent in interface IDirectorypublic IDirectory getRoot()
getRoot in interface IDirectory
public IDirectory newSubdirectory(java.lang.String name)
throws DirectoryException
newSubdirectory in interface IDirectoryname - The name of the new subdirectory.
DirectoryException - If the name is invalid or the subdirectory could
not be constructed.
public void delete()
throws DirectoryException
delete in interface IDirectoryDirectoryException - If the directory could not be deleted.public int size()
size in interface IDirectorypublic java.util.Enumeration keys()
keys in interface IDirectory
public boolean removeObject(java.lang.Object object)
throws DirectoryException
removeObject in interface IDirectoryobject - The object to remove.
DirectoryException - If an error occurs in the underlying directory.
protected electric.directory.Parts getParts(java.lang.String path,
boolean create)
throws DirectoryException
path - The path to parse.create - If true, allow a subdirectory to be created on demand.
DirectoryException
protected IDirectory getSubdirectory(java.lang.String name,
boolean create)
throws DirectoryException
name - The name of the subdirectory.create - If true, allow the subdirectory to be created on demand.
DirectoryException - If the subdirectory could be not created.
public java.util.Enumeration findAll(ISelector selector)
throws DirectoryException
findAll in interface IDirectoryselector -
DirectoryException
public java.lang.Object findFirst(ISelector selector)
throws DirectoryException
findFirst in interface IDirectoryselector -
DirectoryException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||