Class LongsRef

    • Field Detail

      • EMPTY_LONGS

        public static final long[] EMPTY_LONGS
        An empty long array for convenience
      • longs

        public long[] longs
        The contents of the LongsRef. Should never be null.
      • offset

        public int offset
        Offset of first valid long.
      • length

        public int length
        Length of used longs.
    • Constructor Detail

      • LongsRef

        public LongsRef()
        Create a LongsRef with EMPTY_LONGS
      • LongsRef

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

        public LongsRef​(long[] longs,
                        int offset,
                        int length)
        This instance will directly reference longs w/o making a copy. longs should not be null
    • Method Detail

      • hashCode

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

        public boolean longsEquals​(LongsRef other)
      • copyLongs

        public void copyLongs​(LongsRef 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 LongsRef deepCopyOf​(LongsRef other)
        Creates a new IntsRef that points to a copy of the longs 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)