|
FreeHEP API Version current |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.freehep.record.loop.examples.EchoStrings.LineSupplier
Class to read in file line by line.
Field Summary |
Fields inherited from interface org.freehep.record.source.SequentialRecordSource |
UNKNOWN |
Constructor Summary | |
EchoStrings.LineSupplier(String filename)
Create an instance of this class that will read the specified file. |
Method Summary | |
void |
close()
Close the record source and free any associated resources |
Object |
getCurrentRecord()
Get the current record. |
long |
getEstimatedSize()
Returns the number of records in this record source, if known. |
Class |
getRecordClass()
Find out what type of records are returned by this record source. |
String |
getSourceName()
Get the (human readable) name of this record source. |
void |
next()
Go to the next record. |
void |
releaseRecord(Object record)
Releases any resources associated with the specified record. |
void |
rewind()
Repositions the record source before the first record. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public EchoStrings.LineSupplier(String filename) throws FileNotFoundException
filename
- the name of the file to read.Method Detail |
public Object getCurrentRecord() throws EndOfSourceException, IOException
SequentialRecordSource
getCurrentRecord
in interface SequentialRecordSource
null
if no current record.
EndOfSourceException
IOException
public long getEstimatedSize()
SequentialRecordSource
This is allowed to be an approximation (for example the number of events may be known but not the total number of records, or the expected number of records may be known, but the actual number may be different). The primary use of this method is for giving the user feedback on how much of a record source has been read, it should not be used as the limit for a for loop. Use hasNext() instead.
getEstimatedSize
in interface SequentialRecordSource
public void next()
SequentialRecordSource
next
in interface SequentialRecordSource
public Class getRecordClass()
SequentialRecordSource
getRecordClass
in interface SequentialRecordSource
public String getSourceName()
SequentialRecordSource
getSourceName
in interface SequentialRecordSource
public void rewind() throws IOException
SequentialRecordSource
rewind
in interface SequentialRecordSource
IOException
public void releaseRecord(Object record)
SequentialRecordSource
releaseRecord
in interface SequentialRecordSource
public void close() throws IOException
SequentialRecordSource
close
in interface SequentialRecordSource
IOException
|
FreeHEP API Version current |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |