org.modeshape.jcr.query

## Class BufferManager.PackedStringKeySerializer<K extends Comparable<K>>

- java.lang.Object
- - org.mapdb.BTreeKeySerializer<K>
  - - org.modeshape.jcr.query.BufferManager.PackedStringKeySerializer<K>

- Type Parameters:
    `K` - the type to be serialized
  All Implemented Interfaces:
    Serializable, BufferManager.KeySerializerWithComparator<K>
  Enclosing class:
    BufferManager

      public static class BufferManager.PackedStringKeySerializer<K extends Comparable<K>>
      extends org.mapdb.BTreeKeySerializer<K>
      implements Serializable, BufferManager.KeySerializerWithComparator<K>

  Applies delta packing on `java.lang.String`. This serializer splits consequent strings to two parts: shared prefix and different suffix. Only suffix is than stored.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.mapdb.BTreeKeySerializer

      `org.mapdb.BTreeKeySerializer.BasicKeySerializer, org.mapdb.BTreeKeySerializer.Tuple2KeySerializer<A,B>, org.mapdb.BTreeKeySerializer.Tuple3KeySerializer<A,B,C>, org.mapdb.BTreeKeySerializer.Tuple4KeySerializer<A,B,C,D>, org.mapdb.BTreeKeySerializer.Tuple5KeySerializer<A,B,C,D,E>, org.mapdb.BTreeKeySerializer.Tuple6KeySerializer<A,B,C,D,E,F>`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Comparator<K>` | `comparator`

    - ### Fields inherited from class org.mapdb.BTreeKeySerializer

      `BASIC, STRING, TUPLE2, TUPLE3, TUPLE4, ZERO_OR_POSITIVE_INT, ZERO_OR_POSITIVE_LONG`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `` | `BufferManager.PackedStringKeySerializer(StringFactory stringFactory, ValueFactory<K> valueFactory)`
    `protected` | `BufferManager.PackedStringKeySerializer(StringFactory stringFactory, ValueFactory<K> valueFactory, Comparator<K> comparator)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object[]` | `deserialize(DataInput in, int start, int end, int size)`
    `Comparator<K>` | `getComparator()`
    `void` | `serialize(DataOutput out, int start, int end, Object[] keys)`
    `String` | `toString()`
    `org.mapdb.BTreeKeySerializer<K>` | `withComparator(Comparator<?> comparator)`

    - ### Methods inherited from class org.mapdb.BTreeKeySerializer

      `leadingValuePackRead, leadingValuePackWrite`

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

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

- - ### Field Detail

    - #### comparator

          protected final transient Comparator<K extends Comparable<K>> comparator

  - ### Constructor Detail

    - #### BufferManager.PackedStringKeySerializer

          public BufferManager.PackedStringKeySerializer(StringFactory stringFactory,
                                                 ValueFactory<K> valueFactory)

    - #### BufferManager.PackedStringKeySerializer

          protected BufferManager.PackedStringKeySerializer(StringFactory stringFactory,
                                                 ValueFactory<K> valueFactory,
                                                 Comparator<K> comparator)

  - ### Method Detail

    - #### withComparator

          public org.mapdb.BTreeKeySerializer<K> withComparator(Comparator<?> comparator)

      Specified by:
        `withComparator` in interface `BufferManager.KeySerializerWithComparator<K extends Comparable<K>>`

    - #### getComparator

          public Comparator<K> getComparator()

      Specified by:
        `getComparator` in class `org.mapdb.BTreeKeySerializer<K extends Comparable<K>>`

    - #### serialize

          public void serialize(DataOutput out,
                       int start,
                       int end,
                       Object[] keys)
                         throws IOException

      Specified by:
        `serialize` in class `org.mapdb.BTreeKeySerializer<K extends Comparable<K>>`
      Throws:
        `IOException`

    - #### deserialize

          public Object[] deserialize(DataInput in,
                             int start,
                             int end,
                             int size)
                               throws IOException

      Specified by:
        `deserialize` in class `org.mapdb.BTreeKeySerializer<K extends Comparable<K>>`
      Throws:
        `IOException`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.