org.exoplatform.services.jcr.rmi.api.value
Class LongValue

java.lang.Object
  extended by org.exoplatform.services.jcr.rmi.api.value.BaseNonStreamValue
      extended by org.exoplatform.services.jcr.rmi.api.value.LongValue
All Implemented Interfaces:
java.io.Serializable, javax.jcr.Value, ExtendedValue, StatefulValue

public class LongValue
extends BaseNonStreamValue
implements java.io.Serializable, StatefulValue

The LongValue class implements the committed value state for Long values as a part of the State design pattern (Gof) used by this package.

Since:
0.16.4.1
See Also:
SerialValue, Serialized Form

Field Summary
 
Fields inherited from class org.exoplatform.services.jcr.rmi.api.value.BaseNonStreamValue
orderNumber
 
Constructor Summary
protected LongValue(long value)
          Creates an instance for the given long value.
protected LongValue(java.lang.String value)
          Creates an instance for the given string representation of a long.
 
Method Summary
 java.util.Calendar getDate()
          Returns a Calendar instance interpreting the long as the time in milliseconds since the epoch (1.1.1970, 0:00, UTC).
 double getDouble()
          Returns the value converted to a double.
 long getLength()
           
 long getLong()
          Returns the double value.
 int getOrderNumber()
           
 java.lang.String getString()
          Returns the long as a string converted by the Long.toString(long).
 int getType()
          Returns PropertyType.LONG.
protected static long toLong(java.lang.String value)
          Returns the long value represented by the string value.
 
Methods inherited from class org.exoplatform.services.jcr.rmi.api.value.BaseNonStreamValue
getBoolean, getReference, getStream, getValueFormatException, setOrderNumber
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.exoplatform.services.jcr.core.value.ExtendedValue
getReference, setOrderNumber
 
Methods inherited from interface javax.jcr.Value
getBoolean, getStream
 

Constructor Detail

LongValue

protected LongValue(long value)
Creates an instance for the given long value.


LongValue

protected LongValue(java.lang.String value)
             throws javax.jcr.ValueFormatException
Creates an instance for the given string representation of a long.

This implementation uses the Long.valueOf(String) method to convert the string to a long.

Throws:
javax.jcr.ValueFormatException - if the string value cannot be parsed to long.
Method Detail

toLong

protected static long toLong(java.lang.String value)
                      throws javax.jcr.ValueFormatException
Returns the long value represented by the string value.

Throws:
javax.jcr.ValueFormatException - if the string value cannot be parsed to long.

getType

public int getType()
Returns PropertyType.LONG.

Specified by:
getType in interface javax.jcr.Value

getDate

public java.util.Calendar getDate()
Returns a Calendar instance interpreting the long as the time in milliseconds since the epoch (1.1.1970, 0:00, UTC).

Specified by:
getDate in interface javax.jcr.Value
Overrides:
getDate in class BaseNonStreamValue
Returns:
nothing

getLong

public long getLong()
Returns the double value.

Specified by:
getLong in interface javax.jcr.Value
Overrides:
getLong in class BaseNonStreamValue
Returns:
nothing

getString

public java.lang.String getString()
Returns the long as a string converted by the Long.toString(long).

Specified by:
getString in interface javax.jcr.Value

getDouble

public double getDouble()
Returns the value converted to a double.

Specified by:
getDouble in interface javax.jcr.Value
Overrides:
getDouble in class BaseNonStreamValue
Returns:
nothing

getLength

public long getLength()
Specified by:
getLength in interface ExtendedValue

getOrderNumber

public int getOrderNumber()
Specified by:
getOrderNumber in interface ExtendedValue
Overrides:
getOrderNumber in class BaseNonStreamValue


Copyright © 2011 eXo Platform SAS. All Rights Reserved.