|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.myzeo.decoder.ZeoDataDecoder
public class ZeoDataDecoder
Driver application that reads Zeo data records and prints them in XML or human-readable text.
This program decodes sleep records in a zeosleep.dat file into either a human readable format or XML depending upon how it is invoked. If the data is written to standard output then it is output as human readable text. If a file is specified and that file's extension is .xml then the data is output as XML. Any other file extension specified will cause the program to output the human readable version to the specified file.
To output data to standard output invoke this command with just the zeosleep.dat input file name. To output data to an XML file invoke this command with two arguments; the zeosleep.dat file and the intended XML file zeosleep.xml (please include .xml extension).
Field Summary | |
---|---|
static int |
ZEO_DATA_DECODER_VERSION
ZeoDataDecoder version. |
Constructor Summary | |
---|---|
ZeoDataDecoder(java.nio.ByteBuffer in)
Populate the records inside the Zeo decoder based upon the data given in the input byte array. |
Method Summary | |
---|---|
static int |
crc16(byte[] buffer,
int offset,
int length)
Compute the CRC16 value for the input byte buffer. |
static java.util.List<ZeoData> |
decode(byte[] data)
|
java.util.List<ZeoData> |
get_records()
Return the decoded records as a list of ZeoData objects. |
void |
label_naps()
Iterate over the collection of records labeling each record as either a nap or not a nap. |
static void |
main(java.lang.String[] args)
The main method. |
void |
reduce_records()
Reduce the decoder's records down to core records by removing duplicate records for each sleep episode. |
int |
size()
Return the number of records being handled by the decoder. |
java.lang.String |
toHuman()
Generate a human readable string representation of this decoder. |
java.lang.String |
toXML()
Generate an XML string representation of this decoder. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ZEO_DATA_DECODER_VERSION
Constructor Detail |
---|
public ZeoDataDecoder(java.nio.ByteBuffer in) throws java.io.EOFException
in
- A byte buffer that is the source of data for populating
the Zeo records from.
java.io.EOFException
Method Detail |
---|
public static int crc16(byte[] buffer, int offset, int length)
buffer
- Byte array with data to calculate CRC for.offset
- Starting offset for chunk of data to calculate CRC for.length
- Number of bytes in buffer to use in CRC calculation.
public static java.util.List<ZeoData> decode(byte[] data) throws java.io.IOException
java.io.IOException
public java.util.List<ZeoData> get_records()
public void label_naps()
public void reduce_records()
public int size()
public java.lang.String toHuman()
public java.lang.String toXML()
public static void main(java.lang.String[] args)
|
Copyright © 2010, Zeo, Inc. All rights reserved. | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |