Class Pointer

    • Constructor Detail

      • Pointer

        Pointer​(int initialOffset)
        Construct a new Pointer with specified initial offset.
        Parameters:
        initialOffset - int; the initial offset
      • Pointer

        public Pointer()
        Construct a new Pointer with offset 0.
    • Method Detail

      • get

        public int get()
        Retrieve the offset.
        Returns:
        int; the offset
      • getAndIncrement

        public int getAndIncrement​(int increment)
        Retrieve the current value of offset and increment it. The returned value is the value before applying the increment.
        Parameters:
        increment - int; the amount by which the offset must be incremented
        Returns:
        int; the offset (before the increment was added)
      • inc

        public void inc​(int increment)
        Increment the offset.
        Parameters:
        increment - int; the amount by which the offset must be incremented