FreeHEP API
Version v1.1

hep.io.root
Class RootFileReader

java.lang.Object
  |
  +--hep.io.root.RootFileReader
All Implemented Interfaces:
RootObject, TDirectory, TFile, TNamed, TObject

public class RootFileReader
extends Object
implements TFile

A class for reading root files.

Version:
$Id: RootFileReader.java,v 1.13 2002/06/12 23:15:13 duns Exp $
Author:
Tony Johnson (tonyj@slac.stanford.edu)

Field Summary
 
Fields inherited from interface hep.io.root.interfaces.TNamed
rootIOVersion
 
Constructor Summary
RootFileReader(File file)
          Open a root file for reading The DefaultClassFactory will be used for creating classes
RootFileReader(File file, RootClassFactory factory)
          Open a root file for reading
RootFileReader(String file)
          Open a root file for reading.
 
Method Summary
 void close()
          Close the file.
 Object get(String name)
          Get the object associated with a particular key
 ClassLoader getClassLoader()
           
 RootClassFactory getFactory()
           
 TKey getKey(int index)
           
 TKey getKey(String name)
          Gets the key for a specific name.
 TKey getKey(String name, int cycle)
          Gets the key for a specific name and cycle
 TKey getKeyForTitle(String name)
           
 String getName()
          object identifier
 String getTitle()
          object title
 Object getValue(String member)
          Returns the value of a named member variable.
 int nKeys()
           
 RootClass rootClass()
          Returns the class name of this object
 void setClassLoader(ClassLoader loader)
          Set the classloader to use for checking for interfaces and loading proxies.
 List streamerInfo()
          Get the StreamerInfo
 TKey streamerInfoKey()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RootFileReader

public RootFileReader(String file)
               throws IOException
Open a root file for reading. The DefaultClassFactory will be used for creating classes

Parameters:
file - The name of the file to open
See Also:
DefaultClassFactory

RootFileReader

public RootFileReader(File file)
               throws IOException
Open a root file for reading The DefaultClassFactory will be used for creating classes

Parameters:
file - The file to open
See Also:
DefaultClassFactory

RootFileReader

public RootFileReader(File file,
                      RootClassFactory factory)
               throws IOException
Open a root file for reading

Parameters:
file - The file to open
factory - The factory to use for creating root classes
Method Detail

close

public void close()
           throws IOException
Description copied from interface: TFile
Close the file.

Specified by:
close in interface TFile
IOException

getFactory

public RootClassFactory getFactory()

getName

public String getName()
Description copied from interface: TNamed
object identifier

Specified by:
getName in interface TNamed

getTitle

public String getTitle()
Description copied from interface: TNamed
object title

Specified by:
getTitle in interface TNamed

nKeys

public int nKeys()
Specified by:
nKeys in interface TDirectory

getKey

public TKey getKey(int index)
Specified by:
getKey in interface TDirectory

getKeyForTitle

public TKey getKeyForTitle(String name)
Specified by:
getKeyForTitle in interface TDirectory

getKey

public TKey getKey(String name)
Description copied from interface: TDirectory
Gets the key for a specific name. Assumes the highest cycle.

Specified by:
getKey in interface TDirectory

getKey

public TKey getKey(String name,
                   int cycle)
Description copied from interface: TDirectory
Gets the key for a specific name and cycle

Specified by:
getKey in interface TDirectory

streamerInfoKey

public TKey streamerInfoKey()
Specified by:
streamerInfoKey in interface TFile

rootClass

public RootClass rootClass()
Description copied from interface: RootObject
Returns the class name of this object

Specified by:
rootClass in interface RootObject

getValue

public Object getValue(String member)
Description copied from interface: RootObject
Returns the value of a named member variable. Searches in this class or any of its super classes. The value returned will be either
  1. A RootObject
  2. A java.lang.reflect.Array
  3. A Java Object representing a primitive type (int, double etc).
  4. Specified by:
    getValue in interface RootObject
    See Also:
    RootObject, Array

streamerInfo

public List streamerInfo()
                  throws IOException
Get the StreamerInfo

Specified by:
streamerInfo in interface TFile
IOException

get

public Object get(String name)
           throws IOException
Get the object associated with a particular key

IOException

setClassLoader

public void setClassLoader(ClassLoader loader)
Set the classloader to use for checking for interfaces and loading proxies.


getClassLoader

public ClassLoader getClassLoader()

FreeHEP API
Version v1.1

Copyright © 2000-2002 FreeHEP, All Rights Reserved.