Class CounterColumnType

  • All Implemented Interfaces:
    java.util.Comparator<java.nio.ByteBuffer>, AssignmentTestable

    public class CounterColumnType
    extends NumberType<java.lang.Long>
    • Method Detail

      • decompose

        public java.nio.ByteBuffer decompose​(java.lang.Long value)
        Overrides:
        decompose in class AbstractType<java.lang.Long>
      • getString

        public <V> java.lang.String getString​(V value,
                                              ValueAccessor<V> accessor)
        Description copied from class: AbstractType
        get a string representation of the bytes used for various identifier (NOT just for log messages)
        Overrides:
        getString in class AbstractType<java.lang.Long>
      • fromString

        public java.nio.ByteBuffer fromString​(java.lang.String source)
        Description copied from class: AbstractType
        get a byte representation of the given string.
        Specified by:
        fromString in class AbstractType<java.lang.Long>
      • fromJSONObject

        public Term fromJSONObject​(java.lang.Object parsed)
        Description copied from class: AbstractType
        Given a parsed JSON string, return a byte representation of the object.
        Specified by:
        fromJSONObject in class AbstractType<java.lang.Long>
        Parameters:
        parsed - the result of parsing a json string
      • toJSONString

        public java.lang.String toJSONString​(java.nio.ByteBuffer buffer,
                                             ProtocolVersion protocolVersion)
        Description copied from class: AbstractType
        Converts the specified value into its JSON representation.

        The buffer position will stay the same.

        Overrides:
        toJSONString in class AbstractType<java.lang.Long>
        Parameters:
        buffer - the value to convert
        protocolVersion - the protocol version to use for the conversion
        Returns:
        a JSON string representing the specified value
      • toLong

        protected long toLong​(java.nio.ByteBuffer value)
        Description copied from class: NumberType
        Converts the specified value into a long if allowed.
        Overrides:
        toLong in class NumberType<java.lang.Long>
        Parameters:
        value - the value to convert
        Returns:
        the converted value
      • add

        public java.nio.ByteBuffer add​(NumberType<?> leftType,
                                       java.nio.ByteBuffer left,
                                       NumberType<?> rightType,
                                       java.nio.ByteBuffer right)
        Description copied from class: NumberType
        Adds the left argument to the right one.
        Specified by:
        add in class NumberType<java.lang.Long>
        Parameters:
        leftType - the type associated to the left argument
        left - the left argument
        rightType - the type associated to the right argument
        right - the right argument
        Returns:
        the addition result
      • substract

        public java.nio.ByteBuffer substract​(NumberType<?> leftType,
                                             java.nio.ByteBuffer left,
                                             NumberType<?> rightType,
                                             java.nio.ByteBuffer right)
        Description copied from class: NumberType
        Substracts the left argument from the right one.
        Specified by:
        substract in class NumberType<java.lang.Long>
        Parameters:
        leftType - the type associated to the left argument
        left - the left argument
        rightType - the type associated to the right argument
        right - the right argument
        Returns:
        the substraction result
      • multiply

        public java.nio.ByteBuffer multiply​(NumberType<?> leftType,
                                            java.nio.ByteBuffer left,
                                            NumberType<?> rightType,
                                            java.nio.ByteBuffer right)
        Description copied from class: NumberType
        Multiplies the left argument with the right one.
        Specified by:
        multiply in class NumberType<java.lang.Long>
        Parameters:
        leftType - the type associated to the left argument
        left - the left argument
        rightType - the type associated to the right argument
        right - the right argument
        Returns:
        the multiplication result
      • divide

        public java.nio.ByteBuffer divide​(NumberType<?> leftType,
                                          java.nio.ByteBuffer left,
                                          NumberType<?> rightType,
                                          java.nio.ByteBuffer right)
        Description copied from class: NumberType
        Divides the left argument by the right one.
        Specified by:
        divide in class NumberType<java.lang.Long>
        Parameters:
        leftType - the type associated to the left argument
        left - the left argument
        rightType - the type associated to the right argument
        right - the right argument
        Returns:
        the division result
      • mod

        public java.nio.ByteBuffer mod​(NumberType<?> leftType,
                                       java.nio.ByteBuffer left,
                                       NumberType<?> rightType,
                                       java.nio.ByteBuffer right)
        Description copied from class: NumberType
        Return the remainder.
        Specified by:
        mod in class NumberType<java.lang.Long>
        Parameters:
        leftType - the type associated to the left argument
        left - the left argument
        rightType - the type associated to the right argument
        right - the right argument
        Returns:
        the remainder
      • negate

        public java.nio.ByteBuffer negate​(java.nio.ByteBuffer input)
        Description copied from class: NumberType
        Negates the argument.
        Specified by:
        negate in class NumberType<java.lang.Long>
        Parameters:
        input - the argument to negate
        Returns:
        the negated argument