public class CORBARecordSource
extends org.freehep.record.source.AbstractRecordSource
RecordSource wrapped around CORBA HepRep server.
Supports sequential access only, assumes the next event can be loaded by
HepEventServer.setEvent("next"). Designed to be used as a base class for
implementing wrappers for specific CORBA servers.| Modifier and Type | Class and Description |
|---|---|
static class |
CORBARecordSource.Move |
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
_hasNext |
protected boolean |
_hasPrevious |
protected hep.graphics.heprep.HepRep |
_heprep |
protected long |
_index |
protected boolean |
_isHepRep2 |
protected HepEventServer |
_server |
protected long |
_size |
protected EnumSet<CORBARecordSource.Move> |
_supports |
protected org.freehep.record.source.RecordTag |
_tag |
protected static long |
UNKNOWN |
| Constructor and Description |
|---|
CORBARecordSource(String name,
HepEventServer server,
Properties serverInfo) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the record source and release any associated resources.
|
void |
current()
Reloads the current record.
|
protected void |
determineSize() |
long |
getCurrentIndex()
Returns the index of the current record, or -1 if this source is positioned before the first record.
|
hep.graphics.heprep.HepRep |
getCurrentRecord()
Returns the current record.
|
org.freehep.record.source.RecordTag |
getCurrentTag()
Returns the tag of the current record.
|
long |
getEstimatedSize()
Returns the estimated number of records in this source.
|
protected hep.graphics.heprep.HepRep |
getHepRep() |
Class<?> |
getRecordClass()
Returns the Class object that is guaranteed to be a superclass of all records in this source.
|
protected String |
getServerCommand(CORBARecordSource.Move move,
long par,
org.freehep.record.source.RecordTag tag)
Returns the command that needs to be send to the CORBA server to position it for reading the specified record.
|
boolean |
hasCurrent()
Returns true if this source can reload the current record.
|
boolean |
hasIndex(long index)
Returns true if this source has a record with the specified index.
|
boolean |
hasNext()
Returns true if this source can load the next record.
|
boolean |
hasPrevious()
Returns true if this source can load the previous record.
|
boolean |
hasRewind()
Returns true if this source in its current state can be rewound.
|
boolean |
hasShift(long numberOfRecords)
Returns true if this source can shift by numberOfRecords records.
|
void |
jump(long index)
Loads the record specified by the index.
|
void |
jump(org.freehep.record.source.RecordTag tag)
Loads the record specified by the tag.
|
void |
next()
Loads the next record.
|
protected void |
positionServer(CORBARecordSource.Move move,
long par,
org.freehep.record.source.RecordTag tag) |
void |
previous()
Loads the previous record.
|
void |
releaseRecord()
Releases any resources associated with the current record.
|
protected void |
restorePosition() |
void |
rewind()
Positions the cursor of this source before the first record.
|
protected void |
sendCommand(String command) |
protected void |
setCurrentIndex()
Sets _index to the index of the record for which the CORBA server is currently positioned.
|
protected void |
setCurrentTag()
Sets _tag to the tag of the record for which the CORBA server is currently positioned.
|
void |
shift(long numberOfRecords)
Loads the record specified by the offset with respect to the current cursor position.
|
long |
size()
Returns the number of records in this source, after updating it from the CORBA server.
|
boolean |
supportsCurrent()
Returns true if this source supports reloading current record.
|
boolean |
supportsIndex()
Returns true if this source supports selecting records by index.
|
boolean |
supportsNext()
Returns true if this source supports loading next record.
|
boolean |
supportsPrevious()
Returns true if this source supports loading previous record.
|
boolean |
supportsRewind()
Returns true if this source supports rewind operation.
|
boolean |
supportsShift()
Returns true if this source supports selecting records by offset with respect to the current record.
|
boolean |
supportsTag()
Returns true if this source supports selecting records by tag.
|
protected static final long UNKNOWN
protected HepEventServer _server
protected long _size
protected EnumSet<CORBARecordSource.Move> _supports
protected boolean _isHepRep2
protected long _index
protected org.freehep.record.source.RecordTag _tag
protected hep.graphics.heprep.HepRep _heprep
protected boolean _hasNext
protected boolean _hasPrevious
public CORBARecordSource(String name, HepEventServer server, Properties serverInfo)
protected final void determineSize()
public Class<?> getRecordClass()
getRecordClass in interface org.freehep.record.source.RecordSourcegetRecordClass in class org.freehep.record.source.AbstractRecordSourcepublic long size()
size in interface org.freehep.record.source.RecordSourcesize in class org.freehep.record.source.AbstractRecordSourceUnsupportedOperationException - if the number of records is unknown.public long getEstimatedSize()
getEstimatedSize in interface org.freehep.record.source.RecordSourcegetEstimatedSize in class org.freehep.record.source.AbstractRecordSourceUnsupportedOperationException - if the number of records is unknown.public long getCurrentIndex()
getCurrentIndex in interface org.freehep.record.source.RecordSourcegetCurrentIndex in class org.freehep.record.source.AbstractRecordSourcepublic org.freehep.record.source.RecordTag getCurrentTag()
getCurrentTag in interface org.freehep.record.source.RecordSourcegetCurrentTag in class org.freehep.record.source.AbstractRecordSourceIllegalStateException - if there is no current record.public hep.graphics.heprep.HepRep getCurrentRecord()
throws IOException
IllegalStateException - if there is no current record.IOException - if retrieving the current record fails for any reason.public void releaseRecord()
releaseRecord in interface org.freehep.record.source.RecordSourcereleaseRecord in class org.freehep.record.source.AbstractRecordSourcepublic boolean supportsCurrent()
supportsCurrent in interface org.freehep.record.source.RecordSourcesupportsCurrent in class org.freehep.record.source.AbstractRecordSourcepublic boolean supportsNext()
supportsNext in interface org.freehep.record.source.RecordSourcesupportsNext in class org.freehep.record.source.AbstractRecordSourcepublic boolean supportsPrevious()
supportsPrevious in interface org.freehep.record.source.RecordSourcesupportsPrevious in class org.freehep.record.source.AbstractRecordSourcepublic boolean supportsIndex()
supportsIndex in interface org.freehep.record.source.RecordSourcesupportsIndex in class org.freehep.record.source.AbstractRecordSourcepublic boolean supportsTag()
supportsTag in interface org.freehep.record.source.RecordSourcesupportsTag in class org.freehep.record.source.AbstractRecordSourcepublic boolean supportsShift()
supportsShift in interface org.freehep.record.source.RecordSourcesupportsShift in class org.freehep.record.source.AbstractRecordSourcepublic boolean hasCurrent()
hasCurrent in interface org.freehep.record.source.RecordSourcehasCurrent in class org.freehep.record.source.AbstractRecordSourcepublic boolean hasNext()
hasNext in interface org.freehep.record.source.RecordSourcehasNext in class org.freehep.record.source.AbstractRecordSourcepublic boolean hasPrevious()
hasPrevious in interface org.freehep.record.source.RecordSourcehasPrevious in class org.freehep.record.source.AbstractRecordSourcepublic boolean hasIndex(long index)
hasIndex in interface org.freehep.record.source.RecordSourcehasIndex in class org.freehep.record.source.AbstractRecordSourcepublic boolean hasShift(long numberOfRecords)
hasShift in interface org.freehep.record.source.RecordSourcehasShift in class org.freehep.record.source.AbstractRecordSourcepublic void current()
throws IOException,
org.freehep.record.source.NoSuchRecordException
current in interface org.freehep.record.source.RecordSourcecurrent in class org.freehep.record.source.AbstractRecordSourceorg.freehep.record.source.NoSuchRecordException - if there is no current record.IOException - if reloading of the current record fails.UnsupportedOperationException - if this source does not support reloading of the current record.public void next()
throws IOException,
org.freehep.record.source.NoSuchRecordException
next in interface org.freehep.record.source.RecordSourcenext in class org.freehep.record.source.AbstractRecordSourceorg.freehep.record.source.NoSuchRecordException - if there is no current record.IOException - if loading of the next record fails.UnsupportedOperationException - if this source does not support loading the next record.public void previous()
throws IOException,
org.freehep.record.source.NoSuchRecordException
previous in interface org.freehep.record.source.RecordSourceprevious in class org.freehep.record.source.AbstractRecordSourceorg.freehep.record.source.NoSuchRecordException - if there is no previous record.IOException - if loading of the previous record fails.UnsupportedOperationException - if this source does not support loading the previous record.public void jump(long index)
throws IOException,
org.freehep.record.source.NoSuchRecordException
jump in interface org.freehep.record.source.RecordSourcejump in class org.freehep.record.source.AbstractRecordSourceorg.freehep.record.source.NoSuchRecordException - if this source does not have a record with the specified index.IOException - if loading of the requested record fails.UnsupportedOperationException - if this source does not support access by index.public void jump(org.freehep.record.source.RecordTag tag)
throws IOException,
org.freehep.record.source.NoSuchRecordException
jump in interface org.freehep.record.source.RecordSourcejump in class org.freehep.record.source.AbstractRecordSourceorg.freehep.record.source.NoSuchRecordException - if this source does not have a record with the specified tag.IOException - if loading of the requested record fails.UnsupportedOperationException - if this source does not support access by tag.public void shift(long numberOfRecords)
throws IOException,
org.freehep.record.source.NoSuchRecordException
shift in interface org.freehep.record.source.RecordSourceshift in class org.freehep.record.source.AbstractRecordSourceorg.freehep.record.source.NoSuchRecordException - if this source does not have a record with the specified offset.IOException - if loading of the requested record fails.UnsupportedOperationException - if this source does not support access by offset.public boolean supportsRewind()
supportsRewind in interface org.freehep.record.source.RecordSourcesupportsRewind in class org.freehep.record.source.AbstractRecordSourcepublic boolean hasRewind()
hasRewind in interface org.freehep.record.source.RecordSourcehasRewind in class org.freehep.record.source.AbstractRecordSourcepublic void rewind()
throws IOException
rewind in interface org.freehep.record.source.RecordSourcerewind in class org.freehep.record.source.AbstractRecordSourceIOExceptionpublic void close()
throws IOException
close in interface org.freehep.record.source.RecordSourceclose in class org.freehep.record.source.AbstractRecordSourceIOException - if closing fails.protected String getServerCommand(CORBARecordSource.Move move, long par, org.freehep.record.source.RecordTag tag)
protected void setCurrentTag()
protected void setCurrentIndex()
protected void positionServer(CORBARecordSource.Move move, long par, org.freehep.record.source.RecordTag tag) throws IOException, org.freehep.record.source.NoSuchRecordException
IOExceptionorg.freehep.record.source.NoSuchRecordExceptionprotected void restorePosition()
protected void sendCommand(String command) throws org.freehep.record.source.NoSuchRecordException, IOException
org.freehep.record.source.NoSuchRecordExceptionIOExceptionprotected hep.graphics.heprep.HepRep getHepRep()
throws IOException
IOExceptionCopyright © 1996-2013 FreeHEP. All Rights Reserved.