railo.runtime.type.dt
Class TimeSpanImpl

java.lang.Object
  extended by railo.runtime.type.dt.TimeSpanImpl
All Implemented Interfaces:
Serializable, Dumpable, Castable, TimeSpan

public final class TimeSpanImpl
extends Object
implements TimeSpan

TimeSpan Object, represent a timespan

See Also:
Serialized Form

Constructor Summary
TimeSpanImpl(int day, int hour, int minute, int second)
          constructor of the timespan class
TimeSpanImpl(int day, int hour, int minute, int second, int millisecond)
          constructor of the timespan class
 
Method Summary
 Boolean castToBoolean(Boolean defaultValue)
          cast the castable value to a boolean value
 boolean castToBooleanValue()
          cast the castable value to a boolean value
 DateTime castToDateTime()
          cast the castable value to a date time object
 DateTime castToDateTime(DateTime defaultValue)
          cast the castable value to a date time object
 double castToDoubleValue()
          cast the castable value to a double value
 double castToDoubleValue(double defaultValue)
          cast the castable value to a double value
 String castToString()
          cast the castable value to a string, other than the Method toString, this Method can throw a Exception
 String castToString(String defaultValue)
          cast the castable value to a string, return the default value, when the method is not castable
 int compareTo(boolean b)
           
 int compareTo(DateTime dt)
           
 int compareTo(double d)
           
 int compareTo(String str)
           
static TimeSpan fromDays(double value)
           
static TimeSpan fromMillis(long value)
           
 int getDay()
           
 int getHour()
           
 long getMilli()
           
 long getMillis()
           
 int getMinute()
           
 int getSecond()
           
 long getSeconds()
           
 DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp)
          method to print out information to a object as HTML
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TimeSpanImpl

public TimeSpanImpl(int day,
                    int hour,
                    int minute,
                    int second)
constructor of the timespan class

Parameters:
day -
hour -
minute -
second -

TimeSpanImpl

public TimeSpanImpl(int day,
                    int hour,
                    int minute,
                    int second,
                    int millisecond)
constructor of the timespan class

Parameters:
day -
hour -
minute -
second -
Method Detail

fromDays

public static TimeSpan fromDays(double value)

fromMillis

public static TimeSpan fromMillis(long value)

castToString

public String castToString()
Description copied from interface: Castable
cast the castable value to a string, other than the Method toString, this Method can throw a Exception

Specified by:
castToString in interface Castable
Returns:
String representation of the Object

castToString

public String castToString(String defaultValue)
Description copied from interface: Castable
cast the castable value to a string, return the default value, when the method is not castable

Specified by:
castToString in interface Castable
Returns:
String representation of the Object

castToBooleanValue

public boolean castToBooleanValue()
                           throws ExpressionException
Description copied from interface: Castable
cast the castable value to a boolean value

Specified by:
castToBooleanValue in interface Castable
Returns:
boolean Value representation of the Object
Throws:
ExpressionException

castToBoolean

public Boolean castToBoolean(Boolean defaultValue)
Description copied from interface: Castable
cast the castable value to a boolean value

Specified by:
castToBoolean in interface Castable
Returns:
boolean Value representation of the Object

castToDoubleValue

public double castToDoubleValue()
Description copied from interface: Castable
cast the castable value to a double value

Specified by:
castToDoubleValue in interface Castable
Returns:
double Value representation of the Object

castToDoubleValue

public double castToDoubleValue(double defaultValue)
Description copied from interface: Castable
cast the castable value to a double value

Specified by:
castToDoubleValue in interface Castable
Returns:
double Value representation of the Object

castToDateTime

public DateTime castToDateTime()
                        throws ExpressionException
Description copied from interface: Castable
cast the castable value to a date time object

Specified by:
castToDateTime in interface Castable
Returns:
date time representation of the Object
Throws:
ExpressionException

castToDateTime

public DateTime castToDateTime(DateTime defaultValue)
Description copied from interface: Castable
cast the castable value to a date time object

Specified by:
castToDateTime in interface Castable
Parameters:
defaultValue - returned when it is not possible to cast to a dateTime object
Returns:
date time representation of the Object

compareTo

public int compareTo(boolean b)
Specified by:
compareTo in interface Castable

compareTo

public int compareTo(DateTime dt)
              throws PageException
Specified by:
compareTo in interface Castable
Throws:
PageException

compareTo

public int compareTo(double d)
              throws PageException
Specified by:
compareTo in interface Castable
Throws:
PageException

compareTo

public int compareTo(String str)
              throws PageException
Specified by:
compareTo in interface Castable
Throws:
PageException

toDumpData

public DumpData toDumpData(PageContext pageContext,
                           int maxlevel,
                           DumpProperties dp)
Description copied from interface: Dumpable
method to print out information to a object as HTML

Specified by:
toDumpData in interface Dumpable
Returns:
HTML print out

getMillis

public long getMillis()
Specified by:
getMillis in interface TimeSpan
Returns:
returns the timespan in milliseconds

getMilli

public long getMilli()

getSeconds

public long getSeconds()
Specified by:
getSeconds in interface TimeSpan
Returns:
returns the timespan in seconds

toString

public String toString()
Overrides:
toString in class Object

getDay

public int getDay()
Specified by:
getDay in interface TimeSpan
Returns:
Returns the day value.

getHour

public int getHour()
Specified by:
getHour in interface TimeSpan
Returns:
Returns the hour value.

getMinute

public int getMinute()
Specified by:
getMinute in interface TimeSpan
Returns:
Returns the minute value.

getSecond

public int getSecond()
Specified by:
getSecond in interface TimeSpan
Returns:
Returns the second value.


Copyright © 2012 Railo