hep.aida.ref.tree
Class Tree
- java.lang.Object
-
- hep.aida.ref.event.AIDAObservable
-
- hep.aida.ref.tree.Tree
-
- All Implemented Interfaces:
- IAddable, IDevTree, ITree, IsObservable
public class Tree extends AIDAObservable implements IDevTree, IsObservable
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidadd(java.lang.String path, IManagedObject child)This "add" method is called from the IStore, and can create new folders if it is needed.voidaddFromFactory(java.lang.String path, IManagedObject child)This "add" method is called from Factories (HistogramFactory, ...), and can create new folders if it is needed.voidcd(java.lang.String path)Change to a given directory.voidcheckForChildren(java.lang.String path)This message is sent by a listener to indicate interest in a particular path within the tree.voidclose()Closes the underlying store.voidcommit()Commit any open transaction to the underlying store(s).voidcp(java.lang.String oldPath, java.lang.String newPath)Copy an object from a path to another.voidcp(java.lang.String oldPath, java.lang.String newPath, boolean recursive)Copy an object from a path to another.IManagedObjectfind(java.lang.String path)Get the IManagedObject at a given path in the ITree.IManagedObjectfindObject(java.lang.String path)java.lang.StringfindPath(IManagedObject object)Get the full path of an IManagedObject.ITreefindTree(java.lang.String path)Get a mounted ITree at a given path in the current ITree.voidfireConnectionEvent(java.lang.String pathString, boolean connect)java.lang.ObjectgetLock()java.util.MapgetOptions()voidhasBeenFilled(java.lang.String path)Is called by the Store to let Tree know that a particular folder has been filled already.booleanhasStore()voidinit(java.lang.String storeName, boolean readOnly, boolean createNew, java.lang.String storeType, java.lang.String options, boolean readOnlyUserDefined)Associate the tree with a storevoidinit(java.lang.String storeName, java.lang.String storeType, int mode, java.lang.String options)Non-AIDA methods are down here.booleanisReadOnly()Check if the store associated with this ITree is read only.java.lang.String[]listObjectNames()Get the list of names of the IManagedObjects under a given path, including directories (but not "." and "..").java.lang.String[]listObjectNames(java.lang.String path)Get the list of names of the IManagedObjects under a given path, including directories (but not "." and "..").java.lang.String[]listObjectNames(java.lang.String path, boolean recursive)Get the list of names of the IManagedObjects under a given path, including directories (but not "." and "..").java.lang.String[]listObjectTypes()Get the list of types of the IManagedObjects under a given path.java.lang.String[]listObjectTypes(java.lang.String path)Get the list of types of the IManagedObjects under a given path.java.lang.String[]listObjectTypes(java.lang.String path, boolean recursive)Get the list of types of the IManagedObjects under a given path.voidls()List, into a given output stream, all the IManagedObjects, including directories (but not "." and ".."), in a given path.voidls(java.lang.String path)List, into a given output stream, all the IManagedObjects, including directories (but not "." and ".."), in a given path.voidls(java.lang.String path, boolean recursive)List, into a given output stream, all the IManagedObjects, including directories (but not "." and ".."), in a given path.voidls(java.lang.String path, boolean recursive, java.io.OutputStream os)List, into a given output stream, all the IManagedObjects, including directories (but not "." and ".."), in a given path.voidmkdir(java.lang.String path)Create a new directory.voidmkdirs(java.lang.String path)Create a directory recursively.voidmount(java.lang.String path, ITree tree, java.lang.String treePath)Mounts a tree within another (target) tree.voidmv(java.lang.String oldPath, java.lang.String newPath)Move an IManagedObject or a directory from one directory to another.java.lang.Stringname()Get the name of an ITree.java.lang.Stringpwd()Get the path of the current working directory.voidrm(java.lang.String path)Remove an IManagedObject by specifying its path.voidrmdir(java.lang.String path)Remove a directory and all the contents underneath.voidsetFolderIsWatched(java.lang.String path, boolean state)This message is sent by a listener to indicate interest in a particular path within the tree.voidsetLock(java.lang.Object lock)voidsetOverwrite()Set the strategy of what should happen if two objects have the same path.voidsetOverwrite(boolean overwrite)Set the strategy of what should happen if two objects have the same path.java.lang.StringstoreName()Get the name of the store.java.lang.StringstoreType()Get the type of the store.voidsymlink(java.lang.String path, java.lang.String alias)Create a symbolic link to an object in the ITree.voidunmount(java.lang.String path)Unmount a subtree at a given path (mount point).-
Methods inherited from class hep.aida.ref.event.AIDAObservable
addListener, isConnected, removeAllListeners, removeListener, setConnected, setValid, setValidForAll
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface hep.aida.ref.event.IsObservable
addListener, removeAllListeners, removeListener, setValid
-
-
-
-
Method Detail
-
name
public java.lang.String name()
Description copied from interface:ITreeGet the name of an ITree.
-
storeName
public java.lang.String storeName()
Get the name of the store.
-
storeType
public java.lang.String storeType()
Description copied from interface:ITreeGet the type of the store.
-
hasStore
public boolean hasStore()
-
findObject
public IManagedObject findObject(java.lang.String path) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
find
public IManagedObject find(java.lang.String path) throws java.lang.IllegalArgumentException
Get the IManagedObject at a given path in the ITree. The path can either be absolute or relative to the current working directory.
-
findTree
public ITree findTree(java.lang.String path) throws java.lang.IllegalArgumentException
Description copied from interface:ITreeGet a mounted ITree at a given path in the current ITree. The path can either be absolute or relative to the current working directory.
-
close
public void close() throws java.io.IOExceptionCloses the underlying store. Changes will be saved only if commit() has been called before. The call is propagated to the dependent mounted trees.
-
cd
public void cd(java.lang.String path) throws java.lang.IllegalArgumentExceptionChange to a given directory.
-
pwd
public java.lang.String pwd()
Get the path of the current working directory.
-
ls
public void ls() throws java.lang.IllegalArgumentExceptionList, into a given output stream, all the IManagedObjects, including directories (but not "." and ".."), in a given path. Directories end with "/". The list can be recursive. in all the directories under path (the default isfalse.
-
ls
public void ls(java.lang.String path) throws java.lang.IllegalArgumentExceptionList, into a given output stream, all the IManagedObjects, including directories (but not "." and ".."), in a given path. Directories end with "/". The list can be recursive.
-
ls
public void ls(java.lang.String path, boolean recursive) throws java.lang.IllegalArgumentExceptionList, into a given output stream, all the IManagedObjects, including directories (but not "." and ".."), in a given path. Directories end with "/". The list can be recursive.- Specified by:
lsin interfaceITree- Parameters:
path- The path where the list has to be performed (by default the current directory ".").recursive- Iftruethe list is extended recursively in all the directories under path (the default isfalse.- Throws:
java.lang.IllegalArgumentException- If the path does not exist.
-
ls
public void ls(java.lang.String path, boolean recursive, java.io.OutputStream os) throws java.lang.IllegalArgumentExceptionList, into a given output stream, all the IManagedObjects, including directories (but not "." and ".."), in a given path. Directories end with "/". The list can be recursive.- Specified by:
lsin interfaceITree- Parameters:
path- The path where the list has to be performed (by default the current directory ".").recursive- Iftruethe list is extended recursively in all the directories under path (the default isfalse.os- The output stream into which the list is dumped (by default the standard output).- Throws:
java.lang.IllegalArgumentException- If the path does not exist.
-
listObjectNames
public java.lang.String[] listObjectNames() throws java.lang.IllegalArgumentExceptionGet the list of names of the IManagedObjects under a given path, including directories (but not "." and ".."). Directories end with "/". The returned names are appended to the given path unless the latter is ".". in all the directories under path (the default isfalse.- Specified by:
listObjectNamesin interfaceITree- Throws:
java.lang.IllegalArgumentException- If the path does not exist.
-
listObjectNames
public java.lang.String[] listObjectNames(java.lang.String path) throws java.lang.IllegalArgumentExceptionGet the list of names of the IManagedObjects under a given path, including directories (but not "." and ".."). Directories end with "/". The returned names are appended to the given path unless the latter is ".".- Specified by:
listObjectNamesin interfaceITree- Parameters:
path- The path where the list has to be performed (by default the current directory "."). in all the directories under path (the default isfalse.- Throws:
java.lang.IllegalArgumentException- If the path does not exist.
-
listObjectNames
public java.lang.String[] listObjectNames(java.lang.String path, boolean recursive) throws java.lang.IllegalArgumentExceptionGet the list of names of the IManagedObjects under a given path, including directories (but not "." and ".."). Directories end with "/". The returned names are appended to the given path unless the latter is ".".- Specified by:
listObjectNamesin interfaceITree- Parameters:
path- The path where the list has to be performed (by default the current directory ".").recursive- Iftruethe list is extended recursively in all the directories under path (the default isfalse.- Throws:
java.lang.IllegalArgumentException- If the path does not exist.
-
listObjectTypes
public java.lang.String[] listObjectTypes() throws java.lang.IllegalArgumentExceptionGet the list of types of the IManagedObjects under a given path. The types are the leaf class of the Interface, e.g. "IHistogram1D", "ITuple", etc. Directories are marked with "dir". The order of the types is the same as the order for the listObjectNames() method to achieve a one-to-one correspondance between object names and types. in all the directories under path (the default isfalse.- Specified by:
listObjectTypesin interfaceITree- Throws:
java.lang.IllegalArgumentException- If the path does not exist.
-
listObjectTypes
public java.lang.String[] listObjectTypes(java.lang.String path) throws java.lang.IllegalArgumentExceptionGet the list of types of the IManagedObjects under a given path. The types are the leaf class of the Interface, e.g. "IHistogram1D", "ITuple", etc. Directories are marked with "dir". The order of the types is the same as the order for the listObjectNames() method to achieve a one-to-one correspondance between object names and types.- Specified by:
listObjectTypesin interfaceITree- Parameters:
path- The path where the list has to be performed (by default the current directory "."). in all the directories under path (the default isfalse.- Throws:
java.lang.IllegalArgumentException- If the path does not exist.
-
listObjectTypes
public java.lang.String[] listObjectTypes(java.lang.String path, boolean recursive) throws java.lang.IllegalArgumentExceptionGet the list of types of the IManagedObjects under a given path. The types are the leaf class of the Interface, e.g. "IHistogram1D", "ITuple", etc. Directories are marked with "dir". The order of the types is the same as the order for the listObjectNames() method to achieve a one-to-one correspondance between object names and types.- Specified by:
listObjectTypesin interfaceITree- Parameters:
path- The path where the list has to be performed (by default the current directory ".").recursive- Iftruethe list is extended recursively in all the directories under path (the default isfalse.- Throws:
java.lang.IllegalArgumentException- If the path does not exist.
-
mkdir
public void mkdir(java.lang.String path) throws java.lang.IllegalArgumentExceptionCreate a new directory. Given a path only the last directory in it is created if all the intermediate subdirectories already exist.
-
mkdirs
public void mkdirs(java.lang.String path) throws java.lang.IllegalArgumentExceptionCreate a directory recursively. Given a path the last directory and all the intermediate non-existing subdirectories are created.
-
rmdir
public void rmdir(java.lang.String path) throws java.lang.IllegalArgumentExceptionRemove a directory and all the contents underneath.
-
rm
public void rm(java.lang.String path) throws java.lang.IllegalArgumentExceptionRemove an IManagedObject by specifying its path. If the path points to a mount point, the mount point should first commit, then close and delete the tree object.
-
findPath
public java.lang.String findPath(IManagedObject object) throws java.lang.IllegalArgumentException
Get the full path of an IManagedObject.
-
mv
public void mv(java.lang.String oldPath, java.lang.String newPath) throws java.lang.IllegalArgumentExceptionMove an IManagedObject or a directory from one directory to another.
-
commit
public void commit() throws java.io.IOExceptionCommit any open transaction to the underlying store(s). It flushes objects into the disk for non-memory-mapped stores.
-
setOverwrite
public void setOverwrite()
Set the strategy of what should happen if two objects have the same path. Default is overwrite.- Specified by:
setOverwritein interfaceITree
-
setOverwrite
public void setOverwrite(boolean overwrite)
Set the strategy of what should happen if two objects have the same path. Default is overwrite.- Specified by:
setOverwritein interfaceITree- Parameters:
overwrite-trueto enable overwriting.
-
cp
public void cp(java.lang.String oldPath, java.lang.String newPath) throws java.lang.IllegalArgumentExceptionCopy an object from a path to another.
-
cp
public void cp(java.lang.String oldPath, java.lang.String newPath, boolean recursive) throws java.lang.IllegalArgumentExceptionCopy an object from a path to another.
-
symlink
public void symlink(java.lang.String path, java.lang.String alias) throws java.lang.IllegalArgumentExceptionCreate a symbolic link to an object in the ITree.
-
mount
public void mount(java.lang.String path, ITree tree, java.lang.String treePath) throws java.lang.IllegalArgumentExceptionMounts a tree within another (target) tree. A tree can only be mounted once. Example:target.mount("/home/tonyj",tree,"/");
-
unmount
public void unmount(java.lang.String path) throws java.lang.IllegalArgumentExceptionUnmount a subtree at a given path (mount point). Whenever a tree is destroyed it first unmounts all dependent trees.
-
init
public void init(java.lang.String storeName, java.lang.String storeType, int mode, java.lang.String options) throws java.io.IOExceptionNon-AIDA methods are down here.- Throws:
java.io.IOException
-
init
public void init(java.lang.String storeName, boolean readOnly, boolean createNew, java.lang.String storeType, java.lang.String options, boolean readOnlyUserDefined) throws java.io.IOExceptionAssociate the tree with a store- Parameters:
storeName- The name of the output storage unit.readOnly-trueif the tree is readonly.createNew-trueif the tree has to create a new file.storeType- The type of the output storage unit.- Throws:
java.io.IOException
-
hasBeenFilled
public void hasBeenFilled(java.lang.String path) throws java.lang.IllegalArgumentExceptionIs called by the Store to let Tree know that a particular folder has been filled already. "path" is path to a folder, cannot point to an Object.- Specified by:
hasBeenFilledin interfaceIAddable- Specified by:
hasBeenFilledin interfaceIDevTree- Parameters:
path- The path of the diretory which has been filled by the Store.- Throws:
java.lang.IllegalArgumentException- If the path does not exist, or if it is not a directory.
-
isReadOnly
public boolean isReadOnly()
Description copied from interface:ITreeCheck if the store associated with this ITree is read only.- Specified by:
isReadOnlyin interfaceITree- Returns:
trueif it is read only.
-
add
public void add(java.lang.String path, IManagedObject child)This "add" method is called from the IStore, and can create new folders if it is needed. Does not overwrite existing objects, just skip them.
-
addFromFactory
public void addFromFactory(java.lang.String path, IManagedObject child)This "add" method is called from Factories (HistogramFactory, ...), and can create new folders if it is needed. It does overwrite existing objects.
-
fireConnectionEvent
public void fireConnectionEvent(java.lang.String pathString, boolean connect)
-
checkForChildren
public void checkForChildren(java.lang.String path)
This message is sent by a listener to indicate interest in a particular path within the tree. If the path corresponds to a folder, that folder will be asked to notify listeners of all existing children, and to continue to notify listeners of any future changes.
-
setFolderIsWatched
public void setFolderIsWatched(java.lang.String path, boolean state)This message is sent by a listener to indicate interest in a particular path within the tree. If the path corresponds to a folder, that folder will be asked to notify listeners of any future changes.
-
getOptions
public java.util.Map getOptions()
-
-
DMelt 3.0 © DataMelt by jWork.ORG