org.apache.jackrabbit.rmi.value
Class StringValue

java.lang.Object
  extended byorg.apache.jackrabbit.rmi.value.BaseNonStreamValue
      extended byorg.apache.jackrabbit.rmi.value.StringValue
All Implemented Interfaces:
Serializable, StatefulValue, Value

public class StringValue
extends BaseNonStreamValue
implements Serializable, StatefulValue

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

Since:
0.16.4.1
See Also:
SerialValue, Serialized Form

Constructor Summary
protected StringValue(String value)
          Creates an instance for the given string value.
 
Method Summary
 boolean getBoolean()
          Returns the string value parsed to a boolean calling the Boolean.valueOf(String) method.
 Calendar getDate()
          Returns the string value parsed to a Calendar using the same formatter as the DateValue class.
 double getDouble()
          Returns the string value parsed to a double calling the Double.valueOf(String) method.
 long getLong()
          Returns the string value parsed to a long calling the Long.valueOf(String) method.
 String getString()
          Returns the string value.
 int getType()
          Returns PropertyType.STRING.
 
Methods inherited from class org.apache.jackrabbit.rmi.value.BaseNonStreamValue
getStream, getValueFormatException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.jcr.Value
getStream
 

Constructor Detail

StringValue

protected StringValue(String value)
Creates an instance for the given string value.

Method Detail

getType

public int getType()
Returns PropertyType.STRING.

Specified by:
getType in interface Value

getString

public String getString()
Returns the string value.

Specified by:
getString in interface Value

getLong

public long getLong()
             throws ValueFormatException
Returns the string value parsed to a long calling the Long.valueOf(String) method.

Specified by:
getLong in interface Value
Overrides:
getLong in class BaseNonStreamValue
Returns:
nothing
Throws:
ValueFormatException - if the string cannot be parsed to long.

getDouble

public double getDouble()
                 throws ValueFormatException
Returns the string value parsed to a double calling the Double.valueOf(String) method.

Specified by:
getDouble in interface Value
Overrides:
getDouble in class BaseNonStreamValue
Returns:
nothing
Throws:
ValueFormatException - if the string cannot be parsed to double.

getDate

public Calendar getDate()
                 throws ValueFormatException
Returns the string value parsed to a Calendar using the same formatter as the DateValue class. This formatting bears the same issues as parsing and formatting that class.

Specified by:
getDate in interface Value
Overrides:
getDate in class BaseNonStreamValue
Returns:
nothing
Throws:
ValueFormatException - if the string cannot be parsed into a Calendar instance.

getBoolean

public boolean getBoolean()
Returns the string value parsed to a boolean calling the Boolean.valueOf(String) method.

Specified by:
getBoolean in interface Value
Overrides:
getBoolean in class BaseNonStreamValue
Returns:
nothing


Copyright © 2004-2006 . All Rights Reserved.