org.apache.cassandra.utils

## Class IntervalTree.Serializer<C extends java.lang.Comparable<? super C>,D,I extends Interval<C,D>>

- java.lang.Object
- - org.apache.cassandra.utils.IntervalTree.Serializer<C,D,I>

All Implemented Interfaces:
  IVersionedSerializer<IntervalTree<C,D,I>>

Enclosing class:
  IntervalTree<C extends java.lang.Comparable<? super C>,D,I extends Interval<C,D>>

    public static class IntervalTree.Serializer<C extends java.lang.Comparable<? super C>,D,I extends Interval<C,D>>
    extends java.lang.Object
    implements IVersionedSerializer<IntervalTree<C,D,I>>

### Method Summary

All Methods Instance Methods Concrete Methods
`IntervalTree<C,D,I>` `deserialize(DataInputPlus in, int version)` Deserialize an IntervalTree whose keys use the natural ordering.
`IntervalTree<C,D,I>` `deserialize(DataInputPlus in, int version, java.util.Comparator<C> comparator)`
`void` `serialize(IntervalTree<C,D,I> it, DataOutputPlus out, int version)` Serialize the specified type into the specified DataOutputStream instance.
`long` `serializedSize(IntervalTree<C,D,I> it, int version)` Calculate serialized size of object without actually serializing.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### serialize

    public void serialize(IntervalTree<C,D,I> it,
                          DataOutputPlus out,
                          int version)
                   throws java.io.IOException

Description copied from interface: `IVersionedSerializer`
Serialize the specified type into the specified DataOutputStream instance.

Specified by:
  `serialize` in interface `IVersionedSerializer<IntervalTree<C extends java.lang.Comparable<? super C>,D,I extends Interval<C,D>>>`
Parameters:
  `it` - type that needs to be serialized
  `out` - DataOutput into which serialization needs to happen.
  `version` - protocol version
Throws:
  `java.io.IOException` - if serialization fails

#### deserialize

    public IntervalTree<C,D,I> deserialize(DataInputPlus in,
                                           int version)
                                    throws java.io.IOException

Deserialize an IntervalTree whose keys use the natural ordering. Use deserialize(DataInput, int, Comparator) instead if the interval tree is to use a custom comparator, as the comparator is *not* serialized.

Specified by:
  `deserialize` in interface `IVersionedSerializer<IntervalTree<C extends java.lang.Comparable<? super C>,D,I extends Interval<C,D>>>`
Parameters:
  `in` - DataInput from which deserialization needs to happen.
  `version` - protocol version
Returns:
  the type that was deserialized
Throws:
  `java.io.IOException` - if deserialization fails

#### deserialize

    public IntervalTree<C,D,I> deserialize(DataInputPlus in,
                                           int version,
                                           java.util.Comparator<C> comparator)
                                    throws java.io.IOException

Throws:
  `java.io.IOException`

#### serializedSize

    public long serializedSize(IntervalTree<C,D,I> it,
                               int version)

Description copied from interface: `IVersionedSerializer`
Calculate serialized size of object without actually serializing.

Specified by:
  `serializedSize` in interface `IVersionedSerializer<IntervalTree<C extends java.lang.Comparable<? super C>,D,I extends Interval<C,D>>>`
Parameters:
  `it` - object to calculate serialized size
  `version` - protocol version
Returns:
  serialized size of object t