com.sun.electric.database.geometry.btree.unboxed
Interface Unboxed<V extends java.io.Serializable>

All Known Subinterfaces:
AssociativeCommutativeOperation<S>, AssociativeOperation<S>, UnboxedComparable<V>
All Known Implementing Classes:
UnboxedFloat, UnboxedHalfDouble, UnboxedInt, UnboxedMinMaxHalfDouble, UnboxedPair

public interface Unboxed<V extends java.io.Serializable>

A class which knows how to intrepret sequences of bytes as an object. We use this singleton class which performs operations (such as comparisons) directly on the byte[]'s rather than using some instance of Serializable&Comparable because the latter approach puts heavy stress on the garbage collector and -- much more importantly -- the memory subsystem. By not instantiating heavyweight objects for the keys we let the whole program live lower in the meomory hierarchy. GC is nice, except in your innermost loops.


Method Summary
 V deserialize(byte[] buf, int ofs)
          Deserialize a value; need not be compatible with V.readObject()!
 int getSize()
          Return the size, in bytes, of a value; all values must have the same size
 void serialize(V v, byte[] buf, int ofs)
          Serialize a value; need not be compatible with V.writeObject()!
 

Method Detail

getSize

int getSize()
Return the size, in bytes, of a value; all values must have the same size


deserialize

V deserialize(byte[] buf,
              int ofs)
Deserialize a value; need not be compatible with V.readObject()!


serialize

void serialize(V v,
               byte[] buf,
               int ofs)
Serialize a value; need not be compatible with V.writeObject()!