org.tridas.io.formats.catras
Class CatrasFile

java.lang.Object
  extended by org.tridas.io.formats.catras.CatrasFile
All Implemented Interfaces:
IDendroFile

public class CatrasFile
extends Object
implements IDendroFile


Constructor Summary
CatrasFile(TridasToCatrasDefaults defaults)
           
 
Method Summary
 IMetadataFieldSet getDefaults()
          Gets the defaults that this file uses to save the file
 String getExtension()
          Gets the extension to use for saving this file.
 byte[] getFileAsBytes()
           
static byte getIntAsByte(Integer value)
           
static byte[] getIntAsByteArray(Integer value)
           
static byte[] getIntAsBytePair(Integer value)
           
static byte[] getIntAsBytePair(Integer value, Boolean littleEndian)
          Extract the integer value from a byte pair according to endianess Horror! Java byte is signed! See: http://www.darksleep.com/player/JavaAndUnsignedTypes.html
 org.tridas.interfaces.ITridasSeries[] getSeries()
          Get the series list.
static Integer roundToNext128(Integer ringcount)
          Takes an integer and rounds it to the nearest multiple of 128
 void saveToDisk(OutputStream os)
          An alternative to the normal saveToString() as this is a binary format
 String[] saveToString()
          Saves the file to strings.
 void setDataValues(org.tridas.schema.TridasValues vals)
           
 void setSeries(org.tridas.interfaces.ITridasSeries ser)
          Set the series that this file represents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CatrasFile

public CatrasFile(TridasToCatrasDefaults defaults)
Method Detail

getDefaults

public IMetadataFieldSet getDefaults()
Description copied from interface: IDendroFile
Gets the defaults that this file uses to save the file

Specified by:
getDefaults in interface IDendroFile
Returns:
See Also:
IDendroFile.getDefaults()

getExtension

public String getExtension()
Description copied from interface: IDendroFile
Gets the extension to use for saving this file.

Specified by:
getExtension in interface IDendroFile
Returns:

getSeries

public org.tridas.interfaces.ITridasSeries[] getSeries()
Description copied from interface: IDendroFile
Get the series list.

Specified by:
getSeries in interface IDendroFile
Returns:
See Also:
IDendroFile.getSeries()

setSeries

public void setSeries(org.tridas.interfaces.ITridasSeries ser)
Set the series that this file represents

Parameters:
ser -

setDataValues

public void setDataValues(org.tridas.schema.TridasValues vals)
Parameters:
vals -

getFileAsBytes

public byte[] getFileAsBytes()
                      throws IOException
Throws:
IOException

roundToNext128

public static Integer roundToNext128(Integer ringcount)
Takes an integer and rounds it to the nearest multiple of 128

Parameters:
ringcount -
Returns:

getIntAsBytePair

public static byte[] getIntAsBytePair(Integer value)

getIntAsBytePair

public static byte[] getIntAsBytePair(Integer value,
                                      Boolean littleEndian)
Extract the integer value from a byte pair according to endianess Horror! Java byte is signed! See: http://www.darksleep.com/player/JavaAndUnsignedTypes.html

Parameters:
value - - Integer value to convert (-32511 to 32767)
littleEndian - - use little-endian?
Returns:

getIntAsByteArray

public static byte[] getIntAsByteArray(Integer value)

getIntAsByte

public static byte getIntAsByte(Integer value)

saveToDisk

public void saveToDisk(OutputStream os)
                throws IOException,
                       jxl.write.WriteException
An alternative to the normal saveToString() as this is a binary format

Parameters:
os -
Throws:
IOException
jxl.write.WriteException

saveToString

public String[] saveToString()
Description copied from interface: IDendroFile
Saves the file to strings.

Specified by:
saveToString in interface IDendroFile
Returns:


Copyright © 2011. All Rights Reserved.