org.fudgemsg.types
Class DateTimeFieldType

java.lang.Object
  extended by org.fudgemsg.FudgeFieldType<FudgeDateTime>
      extended by org.fudgemsg.types.DateTimeFieldType
All Implemented Interfaces:
Serializable

public class DateTimeFieldType
extends FudgeFieldType<FudgeDateTime>

The type definition for a date. This is currently backed by a FudgeDateTime. The secondary type mechanism is used to support additional Java representations, such as Date, Calendar and javax.time classes.

See Also:
Serialized Form

Field Summary
static DateTimeFieldType INSTANCE
          Standard Fudge field type: combined date and time.
 
Method Summary
 FudgeDateTime readValue(DataInput input, int dataSize)
          Reads a value of this type to the output.
 void writeValue(DataOutput output, FudgeDateTime datetime)
          Writes a value of this type to the output.
 
Methods inherited from class org.fudgemsg.FudgeFieldType
equals, getFixedSize, getJavaType, getTypeId, getVariableSize, hashCode, isVariableSize, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

INSTANCE

public static final DateTimeFieldType INSTANCE
Standard Fudge field type: combined date and time. See FudgeTypeDictionary.DATETIME_TYPE_ID.

Method Detail

readValue

public FudgeDateTime readValue(DataInput input,
                               int dataSize)
                        throws IOException
Reads a value of this type to the output.

This is intended for use by variable width types and must read the given value. The implementation must read exactly the number of bytes passed into the method.

Overrides:
readValue in class FudgeFieldType<FudgeDateTime>
Parameters:
input - the input source to read the value from, not null
dataSize - the number of bytes of data to read
Returns:
the value that was read
Throws:
IOException - if an error occurs, which must be wrapped by the caller

writeValue

public void writeValue(DataOutput output,
                       FudgeDateTime datetime)
                throws IOException
Writes a value of this type to the output.

This is intended for use by variable width types and must write the given value. The implementation must write exactly the number of bytes returned by the size calculation.

Overrides:
writeValue in class FudgeFieldType<FudgeDateTime>
Parameters:
output - the output target to write the value to, not null
datetime - the value to write
Throws:
IOException - if an error occurs, which must be wrapped by the caller


Copyright 2009-Present by OpenGamma Inc. and individual contributors
Released under the Apache License, Version 2.0