org.fudgemsg.types
Class FudgeDateTime

java.lang.Object
  extended by org.fudgemsg.types.FudgeDateTime
All Implemented Interfaces:
DateProvider, DateTimeProvider, TimeProvider, InstantProvider

public class FudgeDateTime
extends Object
implements DateTimeProvider, InstantProvider

Dummy class for holding a combined Date and Time with the other data available in the Fudge encoding.


Constructor Summary
  FudgeDateTime(Calendar calendar)
          Creates a new Fudge date/time representation.
  FudgeDateTime(DateTimeAccuracy accuracy, DateTimeProvider dateTimeProvider)
          Creates a new Fudge date/time representation.
protected FudgeDateTime(DateTimeAccuracy accuracy, Instant instant)
          Creates a new Fudge date/time representation.
  FudgeDateTime(DateTimeAccuracy accuracy, InstantProvider instantProvider)
          Creates a new Fudge date/time representation.
  FudgeDateTime(DateTimeAccuracy precision, int year, int month, int day, int timezoneOffset, int seconds, int nanos)
          Creates a new Fudge date/time representation.
protected FudgeDateTime(DateTimeAccuracy accuracy, LocalDateTime localDateTime)
          Creates a new Fudge date/time representation.
  FudgeDateTime(DateTimeAccuracy accuracy, OffsetDateTime offsetDateTime)
          Creates a new Fudge date/time representation.
  FudgeDateTime(DateTimeProvider dateTimeProvider)
          Creates a new Fudge date/time representation.
  FudgeDateTime(FudgeDate date, FudgeTime time)
          Creates a new Fudge date/time representation.
  FudgeDateTime(InstantProvider instantProvider)
          Creates a new Fudge date/time representation.
protected FudgeDateTime(LocalDateTime localDateTime)
          Creates a new Fudge date/time representation.
  FudgeDateTime(OffsetDate offsetDate)
          Creates a new Fudge date/time representation.
  FudgeDateTime(OffsetDateTime offsetDateTime)
          Creates a new Fudge date/time representation.
 
Method Summary
 boolean equals(Object o)
          
 DateTimeAccuracy getAccuracy()
          Returns the resolution of the representation
 FudgeDate getDate()
          Returns the date component.
 FudgeTime getTime()
          Returns the time component.
 int hashCode()
          
 Instant toInstant()
          
 LocalDate toLocalDate()
          
 LocalDateTime toLocalDateTime()
          
 LocalTime toLocalTime()
          
 OffsetDate toOffsetDate()
          Returns the date representation as an OffsetDate object.
 OffsetDateTime toOffsetDateTime()
          Returns the representation as an OffsetDateTime object.
 OffsetTime toOffsetTime()
          Returns the time representation as a OffsetTime object.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FudgeDateTime

public FudgeDateTime(DateTimeAccuracy precision,
                     int year,
                     int month,
                     int day,
                     int timezoneOffset,
                     int seconds,
                     int nanos)
Creates a new Fudge date/time representation.

Parameters:
precision - resolution of the representation
year - year
month - month
day - day
timezoneOffset - timezone offset in 15 minute intervals
seconds - seconds since midnight
nanos - nanoseconds within the second

FudgeDateTime

public FudgeDateTime(FudgeDate date,
                     FudgeTime time)
Creates a new Fudge date/time representation.

Parameters:
date - the date
time - the time

FudgeDateTime

protected FudgeDateTime(DateTimeAccuracy accuracy,
                        Instant instant)
Creates a new Fudge date/time representation.

Parameters:
accuracy - resolution of the representation
instant - time instant - the date and time at UTC will be used

FudgeDateTime

public FudgeDateTime(OffsetDateTime offsetDateTime)
Creates a new Fudge date/time representation.

Parameters:
offsetDateTime - date and time

FudgeDateTime

public FudgeDateTime(DateTimeAccuracy accuracy,
                     OffsetDateTime offsetDateTime)
Creates a new Fudge date/time representation.

Parameters:
accuracy - resolution of the representation
offsetDateTime - date and time

FudgeDateTime

public FudgeDateTime(OffsetDate offsetDate)
Creates a new Fudge date/time representation.

Parameters:
offsetDate - date - Midnight on this day will be used for the time

FudgeDateTime

protected FudgeDateTime(LocalDateTime localDateTime)
Creates a new Fudge date/time representation.

Parameters:
localDateTime - date - Midnight on this day will be used for the time

FudgeDateTime

protected FudgeDateTime(DateTimeAccuracy accuracy,
                        LocalDateTime localDateTime)
Creates a new Fudge date/time representation.

Parameters:
accuracy - resolution of the representation
localDateTime - date and time

FudgeDateTime

public FudgeDateTime(InstantProvider instantProvider)
Creates a new Fudge date/time representation.

Parameters:
instantProvider - provides an instant - the date and time at UTC will be used

FudgeDateTime

public FudgeDateTime(DateTimeAccuracy accuracy,
                     InstantProvider instantProvider)
Creates a new Fudge date/time representation.

Parameters:
accuracy - resolution of the representation
instantProvider - provides an instant - the date and time at UTC will be used

FudgeDateTime

public FudgeDateTime(DateTimeProvider dateTimeProvider)
Creates a new Fudge date/time representation.

Parameters:
dateTimeProvider - provides the date and time

FudgeDateTime

public FudgeDateTime(DateTimeAccuracy accuracy,
                     DateTimeProvider dateTimeProvider)
Creates a new Fudge date/time representation.

Parameters:
accuracy - resolution of the representation
dateTimeProvider - provides the date and time

FudgeDateTime

public FudgeDateTime(Calendar calendar)
Creates a new Fudge date/time representation.

Parameters:
calendar - representation of the date and time
Method Detail

getDate

public FudgeDate getDate()
Returns the date component.

Returns:
the date

getTime

public FudgeTime getTime()
Returns the time component.

Returns:
the time

getAccuracy

public DateTimeAccuracy getAccuracy()
Returns the resolution of the representation

Returns:
the resolution

equals

public boolean equals(Object o)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

toString

public String toString()

Overrides:
toString in class Object

toLocalDate

public LocalDate toLocalDate()

Specified by:
toLocalDate in interface DateProvider

toLocalDateTime

public LocalDateTime toLocalDateTime()

Specified by:
toLocalDateTime in interface DateTimeProvider

toLocalTime

public LocalTime toLocalTime()

Specified by:
toLocalTime in interface TimeProvider

toOffsetDate

public OffsetDate toOffsetDate()
Returns the date representation as an OffsetDate object.

Returns:
the date

toOffsetDateTime

public OffsetDateTime toOffsetDateTime()
Returns the representation as an OffsetDateTime object.

Returns:
the date and time

toOffsetTime

public OffsetTime toOffsetTime()
Returns the time representation as a OffsetTime object.

Returns:
the time

toInstant

public Instant toInstant()

Specified by:
toInstant in interface InstantProvider


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