Class GridLongList

    • Field Detail

      • EMPTY_ARRAY

        public static final long[] EMPTY_ARRAY
        Empty array.
    • Constructor Detail

      • GridLongList

        public GridLongList()
      • GridLongList

        public GridLongList​(int size)
        Parameters:
        size - Size.
      • GridLongList

        public GridLongList​(long[] arr)
        Parameters:
        arr - Array.
    • Method Detail

      • asList

        public static GridLongList asList​(long... vals)
        Parameters:
        vals - Values.
        Returns:
        List from values.
      • hashCode

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

        public void addAll​(GridLongList l)
        Parameters:
        l - List to add all elements of.
      • add

        public void add​(long x)
        Add element to this array.
        Parameters:
        x - Value.
      • clear

        public void clear()
        Clears the list.
      • copyWithout

        public GridLongList copyWithout​(GridLongList l)
        Returns (possibly reordered) copy of this list, excluding all elements of given list.
        Parameters:
        l - List of elements to remove.
        Returns:
        New list without all elements from l.
      • get

        public long get​(int i)
        Parameters:
        i - Index.
        Returns:
        Value.
      • size

        public int size()
        Returns:
        Size.
      • isEmpty

        public boolean isEmpty()
        Returns:
        True if this list has no elements.
      • contains

        public boolean contains​(long l)
        Parameters:
        l - Element to find.
        Returns:
        True if found.
      • truncate

        public void truncate​(int size,
                             boolean last)
        Parameters:
        size - New size.
        last - If true the last elements will be removed, otherwise the first.
      • removeIndex

        public long removeIndex​(int i)
        Removes element by given index.
        Parameters:
        i - Index.
        Returns:
        Removed value.
      • removeValue

        public int removeValue​(int startIdx,
                               long val)
        Removes value from this list.
        Parameters:
        startIdx - Index to begin search with.
        val - Value.
        Returns:
        Index of removed value if the value was found and removed or -1 otherwise.
      • array

        public long[] array()
        Returns:
        Array copy.
      • sort

        public GridLongList sort()
        Sorts this list. Use copy().sort() if you need a defensive copy.
        Returns:
        this For chaining.
      • onAckReceived

        public void onAckReceived()
        Method called when ack message received.
        Specified by:
        onAckReceived in interface Message
      • writeTo

        public boolean writeTo​(ByteBuffer buf,
                               MessageWriter writer)
        Writes this message to provided byte buffer.
        Specified by:
        writeTo in interface Message
        Parameters:
        buf - Byte buffer.
        writer - Writer.
        Returns:
        Whether message was fully written.
      • readFrom

        public boolean readFrom​(ByteBuffer buf,
                                MessageReader reader)
        Reads this message from provided byte buffer.
        Specified by:
        readFrom in interface Message
        Parameters:
        buf - Byte buffer.
        reader - Reader.
        Returns:
        Whether message was fully read.
      • directType

        public short directType()
        Gets message type.
        Specified by:
        directType in interface Message
        Returns:
        Message type.
      • fieldsCount

        public byte fieldsCount()
        Gets fields count.
        Specified by:
        fieldsCount in interface Message
        Returns:
        Fields count.