Class ArrayAdapter<T>

  • Type Parameters:
    T - The underlying type of the array objects.
    All Implemented Interfaces:
    java.io.Serializable, Sequence<T>

    public class ArrayAdapter<T>
    extends ReadOnlySequence<T>
    implements java.io.Serializable
    A read-only implementation of the Sequence interface that wraps an array.

    Used to interface between a Java array and a Pivot control that expects a Sequence of objects (such as a TablePane, Menu, ListView or similar).

    See Also:
    Serialized Form
    • Constructor Detail

      • ArrayAdapter

        public ArrayAdapter​(T... array)
    • Method Detail

      • get

        public T get​(int index)
        Description copied from interface: Sequence
        Retrieves the item at the given index.
        Specified by:
        get in interface Sequence<T>
        Parameters:
        index - The index of the item to retrieve.
        Returns:
        The item at this index in the sequence.
      • indexOf

        public int indexOf​(T item)
        Description copied from interface: Sequence
        Returns the index of an item in the sequence.
        Specified by:
        indexOf in interface Sequence<T>
        Parameters:
        item - The item to locate.
        Returns:
        The index of first occurrence of the item if it exists in the sequence; -1, otherwise.
      • getLength

        public int getLength()
        Description copied from interface: Sequence
        Returns the length of the sequence.
        Specified by:
        getLength in interface Sequence<T>
        Returns:
        The number of items in the sequence.