Overview | Package | Class | Tree | Index | Help

Oracle® Coherence Java API Reference
v3.5.3
E15583-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.tangosol.io
Class DecoratedBinaryDeltaCompressor

    java.lang.Object
      com.tangosol.util.Base
          com.tangosol.util.BitHelper
              com.tangosol.util.ExternalizableHelper
                  com.tangosol.io.DecoratedBinaryDeltaCompressor

All Implemented Interfaces:
  DeltaCompressor

    public class DecoratedBinaryDeltaCompressor

extends ExternalizableHelper
implements DeltaCompressor

A DeltaCompressor implementation that works with decorated binary values.

The delta format is composed of a leading byte that indicates the format; the format indicator byte is one of the DECO_* field values. If the delta value does not begin with one of the leading DECO_* indicators, then the entire delta is the delta for the "value" portion of the decorated result. The grammar follows:

     DecoratedBinaryDelta:
       DECO_DELETE_ALL OptionalValueDelta
       DecorationDeltaList DECO_TERM OptionalValueDelta
       DECO_NO_CHANGES-opt ValueDelta
       null

     OptionalValueDelta:
       VALUE_NO_CHANGES
       VALUE_CHANGES-opt ValueDelta

     ValueDelta:
       Binary (as defined by the underlying DeltaCompressor)

     DecorationDeltaList:
       DecorationDelta
       DecorationDeltaList DecorationDelta

     DecorationDelta:
       DECO_INSERT DecorationId Binary
       DECO_UPDATE DecorationId BinaryDelta
       DECO_DELETE DecorationId

     BinaryDelta:
       Binary (as returned by the BinaryDeltaCompressor)

     Binary:
       Length <bytes>

     DecorationId:
     Length:
       <packed-integer>

Author:
  cp 2009.01.20

Constructor Summary
`DecoratedBinaryDeltaCompressor(DeltaCompressor compressorValue)` Construct a DecoratedBinaryDeltaCompressor.

Method Summary
`ReadBuffer` | `applyDelta(ReadBuffer bufOld, ReadBuffer bufDelta)` Apply a delta to an old value in order to create a new value.
`ReadBuffer` | `extractDelta(ReadBuffer bufOld, ReadBuffer bufNew)` Compare an old value to a new value and generate a delta that represents the changes that must be made to the old value in order to transform it into the new value.

Methods inherited from class com.tangosol.util.BitHelper
`countBits, countBits, countBits, indexOfLSB, indexOfLSB, indexOfLSB, indexOfMSB, indexOfMSB, indexOfMSB, rotateLeft, rotateLeft, rotateLeft, rotateRight, rotateRight, rotateRight, toBitString, toBitString, toBitString`

Constructor Detail

### DecoratedBinaryDeltaCompressor

    public DecoratedBinaryDeltaCompressor(DeltaCompressor compressorValue)

  Construct a DecoratedBinaryDeltaCompressor.

  Parameters:
    `compressorValue` - the compressor responsible for performing delta compression on the underlying Binary value (i.e. the DECO_VALUE decoration)

Method Detail

### extractDelta

    public ReadBuffer extractDelta(ReadBuffer bufOld,
                                   ReadBuffer bufNew)

  Compare an old value to a new value and generate a delta that represents the changes that must be made to the old value in order to transform it into the new value.

  Specified by:
    `extractDelta` in interface `DeltaCompressor`
  Parameters:
    `bufOld` - the old value
    `bufNew` - the new value
  Returns:
    the changes that must be made to the old value in order to transform it into the new value, or null to indicate no change

### applyDelta

    public ReadBuffer applyDelta(ReadBuffer bufOld,
                                 ReadBuffer bufDelta)

  Apply a delta to an old value in order to create a new value.

  Specified by:
    `applyDelta` in interface `DeltaCompressor`
  Parameters:
    `bufOld` - the old value
    `bufDelta` - the delta information returned from `DeltaCompressor.extractDelta(com.tangosol.io.ReadBuffer, com.tangosol.io.ReadBuffer)` to apply to the old value
  Returns:
    the new value

Overview | Package | Class | Tree | Index | Help

Oracle® Coherence Java API Reference
v3.5.3
E15583-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000, 2010, Oracle. All rights reserved.