Class IntsRef

    • Field Detail

      • EMPTY_INTS

        public static final int[] EMPTY_INTS
        An empty integer array for convenience
      • ints

        public int[] ints
        The contents of the IntsRef. Should never be null.
      • offset

        public int offset
        Offset of first valid integer.
      • length

        public int length
        Length of used ints.
    • Constructor Detail

      • IntsRef

        public IntsRef()
        Create a IntsRef with EMPTY_INTS
      • IntsRef

        public IntsRef​(int capacity)
        Create a IntsRef pointing to a new array of size capacity. Offset and length will both be zero.
      • IntsRef

        public IntsRef​(int[] ints,
                       int offset,
                       int length)
        This instance will directly reference ints w/o making a copy. ints should not be null.
    • 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.
      • 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.

      • isValid

        public boolean isValid()
        Performs internal consistency checks. Always returns true (or throws IllegalStateException)