org.apache.jackrabbit.value
Class BinaryValue

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

public class BinaryValue
extends BaseValue

A BinaryValue provides an implementation of the Value interface representing a binary value.


Field Summary
static int TYPE
           
 
Fields inherited from class org.apache.jackrabbit.value.BaseValue
DEFAULT_ENCODING, stream, type
 
Constructor Summary
BinaryValue(byte[] data)
          Constructs a BinaryValue object based on a stream.
BinaryValue(InputStream stream)
          Constructs a BinaryValue object based on a stream.
BinaryValue(String text)
          Constructs a BinaryValue object based on a string.
 
Method Summary
 boolean equals(Object obj)
          Indicates whether some other object is "equal to" this one.
 String getInternalString()
          Gets the string representation of this binary value.
 InputStream getStream()
          
 int hashCode()
          Returns zero to satisfy the Object equals/hashCode contract.
 
Methods inherited from class org.apache.jackrabbit.value.BaseValue
getBoolean, getDate, getDouble, getLong, 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

BinaryValue

public BinaryValue(String text)
Constructs a BinaryValue object based on a string.

Parameters:
text - the string this BinaryValue should represent

BinaryValue

public BinaryValue(InputStream stream)
Constructs a BinaryValue object based on a stream.

Parameters:
stream - the stream this BinaryValue should represent

BinaryValue

public BinaryValue(byte[] data)
Constructs a BinaryValue object based on a stream.

Parameters:
data - the stream this BinaryValue 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 BinaryValue 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

public String getInternalString()
                         throws ValueFormatException,
                                RepositoryException
Gets the string representation of this binary value.

Specified by:
getInternalString in class BaseValue
Returns:
string representation of this binary value.
Throws:
ValueFormatException
RepositoryException - if another error occurs

getStream

public InputStream getStream()
                      throws IllegalStateException,
                             RepositoryException

Specified by:
getStream in interface Value
Overrides:
getStream in class BaseValue
Throws:
IllegalStateException
RepositoryException


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