FreeHEP API
Version current

hep.io.root
Class RootFileReader

java.lang.Object
  extended byhep.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.20 2005/08/10 00:56:29 tonyj Exp $
Author:
Tony Johnson (tonyj@slac.stanford.edu)
Source Code:
RootFileReader.java

Field Summary
 
Fields inherited from interface hep.io.root.interfaces.TNamed
rootIOVersion
 
Constructor Summary
RootFileReader(File file)
          Open a root file for reading
RootFileReader(String file)
          Open a root file for reading.
RootFileReader(URL url)
          Open a file specified by URL for reading with the default options.
RootFileReader(URL url, Map options)
          Open a file specified by URL for reading.
 
Method Summary
 void close()
          Close the file.
 Object get(String name)
          Get the object associated with a particular key
 int getBits()
           
 RootClassFactory getClassFactory()
           
 ClassLoader getClassLoader()
           
 Date getDatimeC()
           
 Date getDatimeM()
           
 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
 int getNbytesKeys()
           
 int getNbytesName()
           
 RootClass getRootClass()
          Get the class of this object
 long getSeekDir()
           
 long getSeekKeys()
           
 long getSeekParent()
           
 String getTitle()
          object title
 int getUniqueID()
           
 int getVersion()
           
 int nKeys()
           
 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(URL url,
                      Map options)
               throws IOException
Open a file specified by URL for reading. The URL may point to source. In the last case the file will be buffered in memory prior to reading, so this method should only be used for small files.

The options argument is used to pass options to the file reader. Supported option include:


RootFileReader

public RootFileReader(URL url)
               throws IOException
Open a file specified by URL for reading with the default options.


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
Throws:
IOException - If the file cannot be opened

RootFileReader

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

Parameters:
file - The file to open
Method Detail

getBits

public int getBits()
Specified by:
getBits in interface TObject

getClassFactory

public RootClassFactory getClassFactory()

setClassLoader

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


getClassLoader

public ClassLoader getClassLoader()

getDatimeC

public Date getDatimeC()
Specified by:
getDatimeC in interface TDirectory

getDatimeM

public Date getDatimeM()
Specified by:
getDatimeM in interface TDirectory

getFactory

public RootClassFactory getFactory()

getKey

public TKey getKey(int index)
Specified by:
getKey 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

getKeyForTitle

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

getName

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

Specified by:
getName in interface TNamed

getNbytesKeys

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

getNbytesName

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

getRootClass

public RootClass getRootClass()
Get the class of this object

Specified by:
getRootClass in interface RootObject
Returns:
The RootClass for this object

getSeekDir

public long getSeekDir()
Specified by:
getSeekDir in interface TDirectory

getSeekKeys

public long getSeekKeys()
Specified by:
getSeekKeys in interface TDirectory

getSeekParent

public long getSeekParent()
Specified by:
getSeekParent in interface TDirectory

getTitle

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

Specified by:
getTitle in interface TNamed

getUniqueID

public int getUniqueID()
Specified by:
getUniqueID in interface TObject

getVersion

public int getVersion()
Specified by:
getVersion in interface TFile

close

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

Specified by:
close in interface TFile
Throws:
IOException

get

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

Throws:
IOException
RootClassNotFound

nKeys

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

streamerInfo

public List streamerInfo()
                  throws IOException
Get the StreamerInfo

Specified by:
streamerInfo in interface TFile
Throws:
IOException

streamerInfoKey

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

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.