Class IntsRef

  • All Implemented Interfaces:
    Cloneable, Comparable<IntsRef>

    public final class IntsRef
    extends Object
    implements Comparable<IntsRef>, Cloneable
    Represents int[], as a slice (offset + length) into an existing int[].
    NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
    • Field Detail

      • EMPTY_INTS

        public static final int[] EMPTY_INTS
      • ints

        public int[] ints
      • offset

        public int offset
      • length

        public int length
    • Constructor Detail

      • IntsRef

        public IntsRef()
      • IntsRef

        public IntsRef​(int capacity)
      • IntsRef

        public IntsRef​(int[] ints,
                       int offset,
                       int length)
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • intsEquals

        public boolean intsEquals​(IntsRef other)
      • copyInts

        public void copyInts​(IntsRef other)
      • grow

        public void grow​(int newLength)
        Used to grow the reference array. In general this should not be used as it does not take the offset into account.
        NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
      • deepCopyOf

        public static IntsRef deepCopyOf​(IntsRef other)
        Creates a new IntsRef that points to a copy of the ints from other

        The returned IntsRef will have a length of other.length and an offset of zero.