org.apache.jackrabbit.value
Class StringValue

java.lang.Object
  extended byorg.apache.jackrabbit.value.BaseValue
      extended byorg.apache.jackrabbit.value.StringValue
All Implemented Interfaces:
Value

public class StringValue
extends BaseValue

A StringValue provides an implementation of the Value interface representing a string value.


Field Summary
static int TYPE
           
 
Fields inherited from class org.apache.jackrabbit.value.BaseValue
DEFAULT_ENCODING, stream, type
 
Constructor Summary
StringValue(String text)
          Constructs a StringValue object representing a string.
 
Method Summary
 boolean equals(Object obj)
          Indicates whether some other object is "equal to" this one.
protected  String getInternalString()
          Returns the internal string representation of this value without modifying the value state.
 int hashCode()
          Returns zero to satisfy the Object equals/hashCode contract.
 
Methods inherited from class org.apache.jackrabbit.value.BaseValue
getBoolean, getDate, getDouble, getLong, getStream, getString, getType, setStreamConsumed, setValueConsumed
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE

public static final int TYPE
See Also:
Constant Field Values
Constructor Detail

StringValue

public StringValue(String text)
Constructs a StringValue object representing a string.

Parameters:
text - the string this StringValue should represent
Method Detail

equals

public boolean equals(Object obj)
Indicates whether some other object is "equal to" this one.

The result is true if and only if the argument is not null and is a StringValue object that represents the same value as this object.

Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.

hashCode

public int hashCode()
Returns zero to satisfy the Object equals/hashCode contract. This class is mutable and not meant to be used as a hash key.

Returns:
always zero
See Also:
Object.hashCode()

getInternalString

protected String getInternalString()
                            throws ValueFormatException
Returns the internal string representation of this value without modifying the value state.

Specified by:
getInternalString in class BaseValue
Returns:
the internal string representation
Throws:
ValueFormatException - if the value can not be represented as a String or if the value is null.


Copyright © 2004-2006 The Apache Software Foundation. All Rights Reserved.