edu.iris.Fissures.seed.container
Class Waveform

java.lang.Object
  extended by edu.iris.Fissures.seed.container.SeedObject
      extended by edu.iris.Fissures.seed.container.Waveform
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable

public class Waveform
extends SeedObject

Default waveform container. Data is stored in its native encoded form. This object retains information on the encoding format, the number of samples, and the byte swapping flag.

Version:
2/4/2010
Author:
Robert Casey, IRIS DMC
See Also:
Serialized Form

Constructor Summary
Waveform(byte[] record, int dataOffset, int numSamples, java.lang.String encoding, boolean swapBytes)
          Initialize the waveform object with an encoded data set starting at the offset index indicated.
Waveform(float[] floatData, int maxByteLen, java.lang.String encoding)
          Initialize the waveform object with an array of float values.
Waveform(float[] floatData, int maxByteLen, java.lang.String encoding, float bias)
          Deprecated. 
Waveform(int[] intData, int maxByteLen, java.lang.String encoding)
          Initialize the waveform object with an array of integer values.
Waveform(int[] intData, int maxByteLen, java.lang.String encoding, int bias)
          Deprecated. 
 
Method Summary
 float[] getDecodedFloats()
          Decode waveform data to an array of float values.
 float[] getDecodedFloats(float bias)
          Deprecated. 
 int[] getDecodedIntegers()
          Decode waveform data to an array of integer values.
 int[] getDecodedIntegers(int bias)
          Deprecated. 
 DecompressedData getDecompressedData()
           
 DecompressedData getDecompressedData(int bias)
          Deprecated. 
 byte[] getEncodedBytes()
          Return the raw encoded byte stream.
 java.lang.String getEncoding()
          Return the String representing the encoding format of the data.
 int getLookupId()
          Return a fixed value for the lookup ID.
 int getNumSamples()
          Return the number of samples of this waveform.
 boolean getSwapBytes()
          Return the byte swap flag.
 int getType()
          Return a fixed value representing this SeedObject type.
static void main(java.lang.String[] args)
          Test method.
 void setEncoding(java.lang.String format)
          Identify the encoding of the data contained in this object.
 void setNumSamples(int samples)
          Change the number of samples representing this data, if you dare.
 void setSwapBytes(boolean flag)
          Toggle the swap byte flag to true or false.
 java.lang.String toString()
          Display a string description of this Waveform object's contents.
 
Methods inherited from class edu.iris.Fissures.seed.container.SeedObject
compareTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Waveform

public Waveform(byte[] record,
                int dataOffset,
                int numSamples,
                java.lang.String encoding,
                boolean swapBytes)
Initialize the waveform object with an encoded data set starting at the offset index indicated. The encoding format and byte swap flag is indicated during build time. Encoding format is a predefined String pertaining to a SEED-recognized format. swapBytes is set to true for VAX/8086 word order.


Waveform

@Deprecated
public Waveform(int[] intData,
                           int maxByteLen,
                           java.lang.String encoding,
                           int bias)
         throws SeedInputException,
                SeedException,
                SteimException,
                java.io.IOException
Deprecated. 

Initialize the waveform object with an array of integer values. Encode the data with the specified encoding format to a maximum byte length of maxByteLen. bias is an initial value representing the last sample of the previous Waveform, for use in difference compression. Default value is 0.

Throws:
SeedInputException
SeedException
SteimException
java.io.IOException

Waveform

public Waveform(int[] intData,
                int maxByteLen,
                java.lang.String encoding)
         throws SeedInputException,
                SeedException,
                SteimException,
                java.io.IOException
Initialize the waveform object with an array of integer values. Encode the data with the specified encoding format to a maximum byte length of maxByteLen. Assumed bias value of 0 for differencing compression.

Throws:
SeedInputException
SeedException
SteimException
java.io.IOException

Waveform

@Deprecated
public Waveform(float[] floatData,
                           int maxByteLen,
                           java.lang.String encoding,
                           float bias)
         throws SeedInputException,
                SeedException
Deprecated. 

Initialize the waveform object with an array of float values. Encode the data with the specified encoding format to a maximum byte length of maxByteLen. bias is an initial value representing the last sample of the previous Waveform, for use in difference compression. Default value is 0.

Throws:
SeedInputException
SeedException

Waveform

public Waveform(float[] floatData,
                int maxByteLen,
                java.lang.String encoding)
         throws SeedInputException,
                SeedException
Initialize the waveform object with an array of float values. Encode the data with the specified encoding format to a maximum byte length of maxByteLen. Assumed bias value of 0 for difference compression.

Throws:
SeedInputException
SeedException
Method Detail

getType

public int getType()
Return a fixed value representing this SeedObject type.

Specified by:
getType in class SeedObject

getLookupId

public int getLookupId()
Return a fixed value for the lookup ID. Waveform objects do not need to be distinguished from others, since they are always attached to Blockettes.

Specified by:
getLookupId in class SeedObject

getDecompressedData

@Deprecated
public DecompressedData getDecompressedData(int bias)
                                     throws CodecException,
                                            SeedException
Deprecated. 

Decode waveform data to a standard container object. Indicate bias as a carryover constant from a previous data record, but can be set to zero otherwise.

Throws:
CodecException
SeedException

getDecompressedData

public DecompressedData getDecompressedData()
                                     throws CodecException,
                                            SeedException
Throws:
CodecException
SeedException

getDecodedIntegers

@Deprecated
public int[] getDecodedIntegers(int bias)
                         throws CodecException,
                                SeedException
Deprecated. 

Decode waveform data to an array of integer values. Indicate bias as a carryover constant from a previous data record, but can be set to zero otherwise. (may be deprecated in the future)

Throws:
CodecException
SeedException

getDecodedIntegers

public int[] getDecodedIntegers()
                         throws CodecException,
                                SeedException
Decode waveform data to an array of integer values. Bias is assumed to be zero.

Throws:
CodecException
SeedException

getDecodedFloats

@Deprecated
public float[] getDecodedFloats(float bias)
                         throws SteimException,
                                SeedException,
                                CodecException
Deprecated. 

Decode waveform data to an array of float values. Indicate bias as a carryover constant from a previous data record, but can be set to zero otherwise. (may be deprecated in the future)

Throws:
SteimException
SeedException
CodecException

getDecodedFloats

public float[] getDecodedFloats()
                         throws SteimException,
                                SeedException,
                                CodecException
Decode waveform data to an array of float values.

Throws:
SteimException
SeedException
CodecException

getEncodedBytes

public byte[] getEncodedBytes()
Return the raw encoded byte stream.


getNumSamples

public int getNumSamples()
Return the number of samples of this waveform.


getSwapBytes

public boolean getSwapBytes()
Return the byte swap flag. Indicates true if in VAX/8086 order, since Java is by nature 68000/Sun order.


getEncoding

public java.lang.String getEncoding()
Return the String representing the encoding format of the data. contained.


setNumSamples

public void setNumSamples(int samples)
Change the number of samples representing this data, if you dare.


setSwapBytes

public void setSwapBytes(boolean flag)
Toggle the swap byte flag to true or false.


setEncoding

public void setEncoding(java.lang.String format)
Identify the encoding of the data contained in this object.


toString

public java.lang.String toString()
Display a string description of this Waveform object's contents.

Specified by:
toString in class SeedObject

main

public static void main(java.lang.String[] args)
Test method.