FreeHEP API
Version v1.2.2

hep.graphics.heprep
Interface HepRepReader

All Known Implementing Classes:
DefaultHepRepReader, XMLHepRepReader

public interface HepRepReader

HepRepReader interface.

Author:
Mark Donszelmann

Method Summary
 void close()
          Closes the reader and its underlying stream.
 boolean hasNext()
          Is there a next heprep.
 boolean hasRandomAccess()
          Allows random access.
 boolean hasSequentialAccess()
          Allows for sequential access.
 HepRep next()
          Reads the next HepRep from the Reader.
 HepRep read(String name)
          Reads a HepRep by name (random access only).
 void reset()
          Resets a sequential HepRep reader.
 

Method Detail

close

public void close()
           throws IOException
Closes the reader and its underlying stream.

Throws:
IOException - in case of a stream problem.

hasRandomAccess

public boolean hasRandomAccess()
                        throws IOException
Allows random access.

Returns:
true if this reader provides random access
Throws:
IOException - in case of a stream problem.

read

public HepRep read(String name)
            throws IOException,
                   UnsupportedOperationException,
                   NoSuchElementException
Reads a HepRep by name (random access only).

Parameters:
name - for the heprep to be read.
Returns:
heprep.
Throws:
IOException - in case of a stream problem.
UnsupportedOperationException - if the reader does not support random access.
NoSuchElementException - if the heprep is not available.

hasSequentialAccess

public boolean hasSequentialAccess()
                            throws IOException
Allows for sequential access.

Returns:
true if sequential access is possible.
Throws:
IOException - in case of a stream problem.

reset

public void reset()
           throws IOException,
                  UnsupportedOperationException
Resets a sequential HepRep reader.

Throws:
IOException - in case of a stream problem.
UnsupportedOperationException - if the reader does not support sequential access.

hasNext

public boolean hasNext()
                throws IOException,
                       UnsupportedOperationException
Is there a next heprep.

Returns:
true if the next heprep is available.
Throws:
UnsupportedOperationException - if the reader does not support sequential access.
IOException - in case of a stream problem.

next

public HepRep next()
            throws IOException,
                   UnsupportedOperationException,
                   NoSuchElementException
Reads the next HepRep from the Reader.

Returns:
heprep.
Throws:
IOException - in case of a stream problem.
UnsupportedOperationException - if the reader does not support sequential access.
NoSuchElementException - if the heprep is not available, or EOF.

FreeHEP API
Version v1.2.2

Copyright © 2000-2003 FreeHEP, All Rights Reserved.