electric.directory
Interface IDirectory

All Superinterfaces:
IContainer
All Known Implementing Classes:
Directory

public interface IDirectory
extends IContainer

IDirectory defines directory operations, including methods for adding, removing and searching for entries.

Author:
webMethods

Method Summary
 void delete()
          Delete this directory, removing it from its parent 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.
 IDirectory getRoot()
          Return the root of this directory.
 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.
 
Methods inherited from interface electric.directory.IContainer
getPath
 

Method Detail

get

public java.lang.Object get(java.lang.String path)
                     throws DirectoryException
Return the object associated with the the specified path, or null if not found.

Parameters:
path - The path.
Throws:
DirectoryException - If the path is invalid or an exception occurs in the underlying directory.

put

public java.lang.Object put(java.lang.String path,
                            java.lang.Object object)
                     throws DirectoryException
Associate an object with the specified path.

Parameters:
path - The path.
object - The object.
Throws:
DirectoryException - If the path is invalid or an exception occurs in the underlying directory.

remove

public java.lang.Object remove(java.lang.String path)
                        throws DirectoryException
Remove and return the object associate with the specified path, or null if not found.

Parameters:
path - The path.
Throws:
DirectoryException - If the path is invalid or an exception occurs in the underlying directory.

getParent

public IDirectory getParent()
Return the parent of this directory, or null if there is none.


setParent

public void setParent(IDirectory directory)
Set the parent of this directory.

Parameters:
directory - The new parent.

getRoot

public IDirectory getRoot()
Return the root of this directory.


newSubdirectory

public IDirectory newSubdirectory(java.lang.String name)
                           throws DirectoryException
Create and return a new subdirectory with the specified name.

Parameters:
name - The name of the new subdirectory.
Throws:
DirectoryException - If the name is invalid or the subdirectory could not be constructed.

size

public int size()
Return the number of entries in this directory.


delete

public void delete()
            throws DirectoryException
Delete this directory, removing it from its parent directory. This operation does not affect the subdirectories.

Throws:
DirectoryException - If the directory could not be deleted.

keys

public java.util.Enumeration keys()
                           throws DirectoryException
Return an enumeration over all the keys in this directory.

Throws:
DirectoryException - If an error occurs in the underlying directory.

peek

public java.lang.Object peek(java.lang.String path)
                      throws DirectoryException
Return the object with the specified path, or null if not found. If the object is lazy loaded by the underlying directory, this operation return null instead of retrieving the object.

Parameters:
path - The path.
Throws:
DirectoryException - If an error occurs in the underlying directory.

removeObject

public boolean removeObject(java.lang.Object object)
                     throws DirectoryException
Remove the specifed object from the directory. Return true if the object was found and removed, otherwise return false.

Parameters:
object - The object to remove.
Throws:
DirectoryException - If an error occurs in the underlying directory.

findAll

public java.util.Enumeration findAll(ISelector selector)
                              throws DirectoryException
Parameters:
selector -
Throws:
DirectoryException

findFirst

public java.lang.Object findFirst(ISelector selector)
                           throws DirectoryException
Parameters:
selector -
Throws:
DirectoryException


copyright© 2001-2004 by webMethods All Rights Reserved.