Class AbstractOperandParser<T>

    • Constructor Detail

      • AbstractOperandParser

        public AbstractOperandParser()
    • Method Detail

      • parseLength

        public static short parseLength​(byte op)
      • create

        protected abstract T create​(Set<String> opValues)
        Creates operand from a set of operand values.
        Parameters:
        opValues - set of operand values
        Returns:
        specific type of operand
      • serialize

        protected abstract void serialize​(T op,
                                          int length,
                                          boolean endOfList,
                                          io.netty.buffer.ByteBuf buffer)
        Serializes operand to bytes.
        Parameters:
        op - operand to be serialized
        length - value of the 'length' field
        endOfList - if this operand is at the end of the list
        buffer - where the operand will be serialized to
      • parse

        protected abstract T parse​(byte op)
        Parses operand from byte value.
        Parameters:
        op - byte representation of an operand
        Returns:
        operand object
      • toString

        protected abstract String toString​(T op,
                                           boolean isFirst)
        Creates a string representation of the operand. E.g. : 'and does not match'
        Parameters:
        op - operand
        isFirst - true if this operand is the first in list of operands
        Returns:
        String representation of the operand