Package io.keikai.doc.collab.utils
Class UpdateDecoderV2
- java.lang.Object
-
- io.keikai.doc.collab.utils.DSDecoderV2
-
- io.keikai.doc.collab.utils.UpdateDecoderV2
-
- All Implemented Interfaces:
DSDecoder,UpdateDecoder
public class UpdateDecoderV2 extends DSDecoderV2 implements UpdateDecoder
-
-
Field Summary
-
Fields inherited from class io.keikai.doc.collab.utils.DSDecoderV2
_restDecoder
-
-
Constructor Summary
Constructors Constructor Description UpdateDecoderV2(Decoder decoder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectreadAny()Uint8ArrayreadBuf()intreadClient()Read the next client ID.intreadInfo()java.lang.ObjectreadJSON()This is mainly here for legacy purposes.java.lang.StringreadKey()IDreadLeftID()intreadLen()Write len of a struct - well suited for Opt RLE encoder.booleanreadParentInfo()IDreadRightID()java.lang.StringreadString()intreadTypeRef()-
Methods inherited from class io.keikai.doc.collab.utils.DSDecoderV2
getRestDecoder, readDsClock, readDsLen, resetDsCurVal
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.keikai.doc.collab.utils.DSDecoder
getRestDecoder, readDsClock, readDsLen, resetDsCurVal
-
-
-
-
Constructor Detail
-
UpdateDecoderV2
public UpdateDecoderV2(Decoder decoder)
-
-
Method Detail
-
readLeftID
public ID readLeftID()
- Specified by:
readLeftIDin interfaceUpdateDecoder- Returns:
- ID with the left client ID and clock
-
readRightID
public ID readRightID()
- Specified by:
readRightIDin interfaceUpdateDecoder- Returns:
- ID with the right client ID and clock
-
readClient
public int readClient()
Read the next client ID. Use this in favor of readID whenever possible to reduce the number of objects created.- Specified by:
readClientin interfaceUpdateDecoder
-
readInfo
public int readInfo()
- Specified by:
readInfoin interfaceUpdateDecoder- Returns:
- info An unsigned 8-bit integer
-
readString
public java.lang.String readString()
- Specified by:
readStringin interfaceUpdateDecoder- Returns:
- the next string
-
readParentInfo
public boolean readParentInfo()
- Specified by:
readParentInfoin interfaceUpdateDecoder- Returns:
- parent info as a boolean
-
readTypeRef
public int readTypeRef()
- Specified by:
readTypeRefin interfaceUpdateDecoder- Returns:
- Type reference as an unsigned 8-bit integer
-
readLen
public int readLen()
Description copied from interface:UpdateDecoderWrite len of a struct - well suited for Opt RLE encoder.- Specified by:
readLenin interfaceUpdateDecoder- Returns:
- length of a struct, well suited for Opt RLE decoder
-
readAny
public java.lang.Object readAny()
- Specified by:
readAnyin interfaceUpdateDecoder- Returns:
- the next "any" value
-
readBuf
public Uint8Array readBuf()
- Specified by:
readBufin interfaceUpdateDecoder- Returns:
- the next byte array
-
readJSON
public java.lang.Object readJSON()
This is mainly here for legacy purposes. Initially, we encoded objects using JSON. Now we use the much faster lib0/any-encoder. This method mainly exists for legacy purposes for the v1 encoder.- Specified by:
readJSONin interfaceUpdateDecoder- Returns:
- the next JSON object
-
readKey
public java.lang.String readKey()
- Specified by:
readKeyin interfaceUpdateDecoder- Returns:
- the next key string
-
-