|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.javaseis.properties.SeisTraceProperties
public class SeisTraceProperties
Title: JavaSeis Trace Property Handler
Description: An initial design for trace property handling for JavaSeis datasets. This design uses Java Properties files for persistence, and a HashMap from the Collections interface to hold property descriptions in memory at run time. The descriptions provide the header name and location in the binary trace header records. A Java NIO ByteBuffer holds the binary trace header records in memory. Typed views (int, float, etc) of the ByteBuffer are then used to return typed values for a particular header element back to the user.
Copyright: Copyright (c) 2005
Company: JavaSeis.org
Field Summary | |
---|---|
(package private) java.nio.DoubleBuffer |
_doubleView
|
(package private) java.nio.FloatBuffer |
_floatView
|
(package private) java.util.Properties |
_fp
|
(package private) java.nio.ByteBuffer |
_headers
|
(package private) int |
_index
|
(package private) java.nio.IntBuffer |
_intView
|
(package private) java.nio.LongBuffer |
_longView
|
(package private) java.util.Map |
_map
|
(package private) SeisTraceProperty |
_prop
|
(package private) int |
_reclen
|
(package private) java.nio.ShortBuffer |
_shortView
|
(package private) Seisio |
_sio
|
Constructor Summary | |
---|---|
SeisTraceProperties()
Construct a new trace property handler. |
|
SeisTraceProperties(java.nio.ByteBuffer headers)
Construct a new trace property handler. |
Method Summary | ||
---|---|---|
void |
add(SeisTraceProperty prop)
Add a property description to this trace property handler |
|
SeisTraceProperty |
get(java.lang.String name)
Return a trace property descriptor for a particular header entry |
|
double |
getDouble(java.lang.String name)
|
|
float |
getFloat(java.lang.String name)
|
|
int |
getInt(java.lang.String name)
|
|
|
getValue(java.lang.String name)
Generic method for returning values of trace properties as "wrapped" primitives, i.e. |
|
void |
load(java.io.InputStream is)
Load a set of trace property descriptions from a Java Properties file |
|
static void |
main(java.lang.String[] args)
|
|
double |
putDouble(java.lang.String name,
double d)
|
|
float |
putFloat(java.lang.String name,
float f)
|
|
int |
putInt(java.lang.String name,
int i)
|
|
int |
recordLength()
Return the current record length for the property catalog |
|
void |
setBuffer(java.nio.ByteBuffer headers)
Set the header buffer for this handler. |
|
void |
setIndex(int index)
Set the index of the trace property record for subsequent operations |
|
|
setValue(java.lang.String name,
T value)
Generic method for setting "typed" values of trace properties. |
|
int |
size()
Return the number of properties in the catalog |
|
void |
store(java.io.OutputStream os)
Store the contents of the TraceProperty catalog to an output stream in Java Properties format. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
java.nio.DoubleBuffer _doubleView
java.nio.FloatBuffer _floatView
java.util.Properties _fp
java.nio.ByteBuffer _headers
int _index
java.nio.IntBuffer _intView
java.nio.LongBuffer _longView
java.util.Map _map
SeisTraceProperty _prop
int _reclen
java.nio.ShortBuffer _shortView
Seisio _sio
Constructor Detail |
---|
public SeisTraceProperties()
public SeisTraceProperties(java.nio.ByteBuffer headers)
headers
- buffer containing trace header recordsMethod Detail |
---|
public void add(SeisTraceProperty prop)
prop
- SeisTraceProperty that will be added to the property map
for this handler.public SeisTraceProperty get(java.lang.String name)
name
- String containing the name of the trace property for which
a descriptor should be returned. Note that this method returns the
descriptor for the trace property, not the value.
public double getDouble(java.lang.String name)
public float getFloat(java.lang.String name)
public int getInt(java.lang.String name)
public <T> T getValue(java.lang.String name)
name
- String containing the name of the trace property for which
a value should be returned.
public void load(java.io.InputStream is) throws java.io.IOException
is
- InputStream for the input properties
java.io.IOException
- on I/O errorspublic static void main(java.lang.String[] args) throws SeisException
SeisException
public double putDouble(java.lang.String name, double d)
public float putFloat(java.lang.String name, float f)
public int putInt(java.lang.String name, int i)
public int recordLength()
public void setBuffer(java.nio.ByteBuffer headers)
headers
- buffer containing trace header recordspublic void setIndex(int index)
index
- int trace index to be used for subsequent operationspublic <T> T setValue(java.lang.String name, T value)
name
- String containing the name of the trace property for which
a value should be set.value
- "wrapped" primitive type, i.e. Integer, Float, Double ...
public int size()
public void store(java.io.OutputStream os) throws java.io.IOException
os
- OutputStream that will receive the property catalog
java.io.IOException
- on I/O errors
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |