Class BitwiseShiftRight

  • All Implemented Interfaces:
    Operator, BinaryOperator, BitwiseOperator

    public class BitwiseShiftRight
    extends NumericOperation
    implements BitwiseOperator
    Given two expressions that both evaluate to numeric values, a BinaryExpression using this operator computes a new number built with the bits of the first argument's value shifted to the right by an amount specified by the second argument's value. Excess bits on the right are dropped, while new bits on the left preserve the sign of the original first argument's value: if it was negative, bits are set to 1, otherwise they are set to 0.

    First argument expression type: any NumericType
    Second argument expression type: any NumericType
    Computed expression type: NumericType
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static BitwiseShiftRight INSTANCE
      The singleton instance of this class.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected BitwiseShiftRight()
      Builds the operator.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • INSTANCE

        public static final BitwiseShiftRight INSTANCE
        The singleton instance of this class.
    • Constructor Detail

      • BitwiseShiftRight

        protected BitwiseShiftRight()
        Builds the operator. This constructor is visible to allow subclassing: instances of this class should be unique, and the singleton can be retrieved through field INSTANCE.
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object