Class ListTupleList

    • Constructor Detail

      • ListTupleList

        public ListTupleList​(int arity,
                             List<Member> list)
        Creates a ListTupleList.
        Parameters:
        arity - Arity
        list - Backing list
    • Method Detail

      • get

        public Member get​(int slice,
                          int index)
        Description copied from interface: TupleList
        Returns a particular column of a particular row.

        Note that list.get(row, column) is equivalent to list.slice(column).get(row) and list.get(row).get(column) but is more efficient for most implementations of TupleList.

        Specified by:
        get in interface TupleList
        Overrides:
        get in class AbstractTupleList
        Parameters:
        slice - Column ordinal
        index - Row ordinal
        Returns:
        Member at given row and column
      • addTuple

        public void addTuple​(Member... members)
      • slice

        public List<Member> slice​(int column)
        Description copied from interface: TupleList
        Returns a list of the members at a given column.

        The list is modifiable if and only if this TupleList is modifiable. Adding an element to a slice will create a tuple whose members in other columns are null. Removing an element from a slicer will remove a tuple.

        Parameters:
        column - Ordinal of the member in each tuple to project
        Returns:
        List of members
      • cloneList

        public TupleList cloneList​(int capacity)
        Description copied from interface: TupleList
        Creates a copy of this list that has the same type and has a given capacity.

        If capacity is negative, populates the list. A deep copy is made, so that it the contents of the list are not affected to changes to any backing collections.

        Parameters:
        capacity - Capacity
        Returns:
        Copy of list, empty if capacity is non-negative