org.apache.derby.impl.store.access.conglomerate
Class BinaryOrderableWrapper

java.lang.Object
  extended by org.apache.derby.impl.store.access.conglomerate.BinaryOrderableWrapper
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, Formatable, Storable, TypedFormat

 class BinaryOrderableWrapper
extends java.lang.Object
implements Storable

The BinaryOrderableWrapper is a wrapper class which intercepts the readExternal() callback made by raw store during a fetch, and does a comparison instead.


Field Summary
(package private)  int cmp_result
           
(package private)  BinaryOrderable other_object
           
(package private)  BinaryOrderable ref_object
           
 
Constructor Summary
BinaryOrderableWrapper()
           
 
Method Summary
 int getCmpResult()
          Short one line description of routine.
 int getTypeFormatId()
          Get a universally unique identifier for the type of this object.
protected  void init(BinaryOrderable ref_object, BinaryOrderable other_object)
          Short one line description of routine.
 boolean isNull()
          Return whether the value is null or not.
 void readExternal(java.io.ObjectInput in)
          Restore the in-memory representation from the stream.
 void readExternalFromArray(ArrayInputStream in)
           
 void restoreToNull()
          Restore the in-memory representation to the null value.
 void writeExternal(java.io.ObjectOutput out)
          Store the stored representation of the column value in the stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ref_object

BinaryOrderable ref_object

other_object

BinaryOrderable other_object

cmp_result

int cmp_result
Constructor Detail

BinaryOrderableWrapper

BinaryOrderableWrapper()
Method Detail

init

protected void init(BinaryOrderable ref_object,
                    BinaryOrderable other_object)
Short one line description of routine.

Longer descrption of routine.

Parameters:
ref_object - The object that this object is wrapping (ie. being read from disk)
other_object - The object to compare ref_object to.

getCmpResult

public int getCmpResult()
Short one line description of routine.

Longer descrption of routine.

Returns:
The identifier to be used to open the conglomerate later.

getTypeFormatId

public int getTypeFormatId()
Description copied from interface: TypedFormat
Get a universally unique identifier for the type of this object.

Specified by:
getTypeFormatId in interface TypedFormat
Returns:
The identifier. (A UUID stuffed in an array of 16 bytes).

isNull

public boolean isNull()
Return whether the value is null or not. The containerid being zero is what determines nullness; subclasses are not expected to override this method.

Specified by:
isNull in interface Storable
Returns:
true if the value is null and false otherwise.
See Also:
Storable.isNull()

restoreToNull

public void restoreToNull()
Restore the in-memory representation to the null value. The containerid being zero is what determines nullness; subclasses are not expected to override this method.

Specified by:
restoreToNull in interface Storable
See Also:
Storable.restoreToNull()

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Restore the in-memory representation from the stream.

Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.lang.ClassNotFoundException - Thrown if the stored representation is serialized and a class named in the stream could not be found.
java.io.IOException - thrown by readObject()
See Also:
Externalizable.readExternal(java.io.ObjectInput)

readExternalFromArray

public void readExternalFromArray(ArrayInputStream in)
                           throws java.io.IOException,
                                  java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Store the stored representation of the column value in the stream.

A BinaryOrderableWrapper is never used to store data out, only to read data from disk and compare it to another byte stream.

Specified by:
writeExternal in interface java.io.Externalizable
Parameters:
out - Stream to write the object to.
Throws:
java.io.IOException - thrown by writeObject()

Built on Thu 2010-12-23 20:49:13+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.