Class RowList<T>

java.lang.Object
org.tribuo.util.infotheory.impl.RowList<T>
Type Parameters:
T - The type stored in the lists.
All Implemented Interfaces:
Iterable<Row<T>>, Collection<Row<T>>, List<Row<T>>

public final class RowList<T> extends Object implements List<Row<T>>
An implementation of a List which wraps a set of lists.

Each access returns a Row drawn by taking an element from each list.

The rows only expose equals and hashcode, as the information theoretic calculations only care about equality.

  • Constructor Details

    • RowList

      public RowList(Set<List<T>> set)
      Constructs a RowList from a set of lists.
      Parameters:
      set - The feature lists.
  • Method Details

    • size

      public int size()
      Specified by:
      size in interface Collection<T>
      Specified by:
      size in interface List<T>
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Collection<T>
      Specified by:
      isEmpty in interface List<T>
    • contains

      public boolean contains(Object o)
      Specified by:
      contains in interface Collection<T>
      Specified by:
      contains in interface List<T>
    • iterator

      public Iterator<Row<T>> iterator()
      Specified by:
      iterator in interface Collection<T>
      Specified by:
      iterator in interface Iterable<T>
      Specified by:
      iterator in interface List<T>
    • toArray

      public Object[] toArray()
      Specified by:
      toArray in interface Collection<T>
      Specified by:
      toArray in interface List<T>
    • toArray

      public <U> U[] toArray(U[] a)
      Specified by:
      toArray in interface Collection<T>
      Specified by:
      toArray in interface List<T>
    • get

      public Row<T> get(int index)
      Specified by:
      get in interface List<T>
    • containsAll

      public boolean containsAll(Collection<?> c)
      Specified by:
      containsAll in interface Collection<T>
      Specified by:
      containsAll in interface List<T>
    • indexOf

      public int indexOf(Object o)
      Specified by:
      indexOf in interface List<T>
    • lastIndexOf

      public int lastIndexOf(Object o)
      Specified by:
      lastIndexOf in interface List<T>
    • listIterator

      public ListIterator<Row<T>> listIterator()
      Specified by:
      listIterator in interface List<T>
    • listIterator

      public ListIterator<Row<T>> listIterator(int index)
      Specified by:
      listIterator in interface List<T>
    • subList

      public List<Row<T>> subList(int fromIndex, int toIndex)
      Unsupported. Throws UnsupportedOperationException.
      Specified by:
      subList in interface List<T>
      Parameters:
      fromIndex - n/a
      toIndex - n/a
      Returns:
      n/a
    • add

      public boolean add(Row<T> e)
      Unsupported. Throws UnsupportedOperationException.
      Specified by:
      add in interface Collection<T>
      Specified by:
      add in interface List<T>
      Parameters:
      e - n/a
      Returns:
      n/a
    • remove

      public boolean remove(Object o)
      Unsupported. Throws UnsupportedOperationException.
      Specified by:
      remove in interface Collection<T>
      Specified by:
      remove in interface List<T>
      Parameters:
      o - n/a
      Returns:
      n/a
    • addAll

      public boolean addAll(Collection<? extends Row<T>> c)
      Unsupported. Throws UnsupportedOperationException.
      Specified by:
      addAll in interface Collection<T>
      Specified by:
      addAll in interface List<T>
      Parameters:
      c - n/a
      Returns:
      n/a
    • addAll

      public boolean addAll(int index, Collection<? extends Row<T>> c)
      Unsupported. Throws UnsupportedOperationException.
      Specified by:
      addAll in interface List<T>
      Parameters:
      index - n/a
      c - n/a
      Returns:
      n/a
    • removeAll

      public boolean removeAll(Collection<?> c)
      Unsupported. Throws UnsupportedOperationException.
      Specified by:
      removeAll in interface Collection<T>
      Specified by:
      removeAll in interface List<T>
      Parameters:
      c - n/a
      Returns:
      n/a
    • retainAll

      public boolean retainAll(Collection<?> c)
      Unsupported. Throws UnsupportedOperationException.
      Specified by:
      retainAll in interface Collection<T>
      Specified by:
      retainAll in interface List<T>
      Parameters:
      c - n/a
      Returns:
      n/a
    • clear

      public void clear()
      Unsupported. Throws UnsupportedOperationException.
      Specified by:
      clear in interface Collection<T>
      Specified by:
      clear in interface List<T>
    • set

      public Row<T> set(int index, Row<T> element)
      Unsupported. Throws UnsupportedOperationException.
      Specified by:
      set in interface List<T>
      Parameters:
      index - n/a
      element - n/a
      Returns:
      n/a
    • add

      public void add(int index, Row<T> element)
      Unsupported. Throws UnsupportedOperationException.
      Specified by:
      add in interface List<T>
      Parameters:
      index - n/a
      element - n/a
    • remove

      public Row<T> remove(int index)
      Unsupported. Throws UnsupportedOperationException.
      Specified by:
      remove in interface List<T>
      Parameters:
      index - n/a
      Returns:
      n/a