Package snap.util

Class PickList<E>

All Implemented Interfaces:
Cloneable, Iterable<E>, Collection<E>, List<E>

public class PickList<E> extends AbstractList<E> implements Cloneable
A list implementation that includes support for a selection and a synchronized sorted list.
  • Field Details

  • Constructor Details

    • PickList

      public PickList()
      Constructor.
  • Method Details

    • size

      public int size()
      Return list size.
      Specified by:
      size in interface Collection<E>
      Specified by:
      size in interface List<E>
      Specified by:
      size in class AbstractCollection<E>
    • get

      public E get(int anIndex)
      Return list item at index.
      Specified by:
      get in interface List<E>
      Specified by:
      get in class AbstractList<E>
    • add

      public void add(int anIndex, E anItem)
      Add list item.
      Specified by:
      add in interface List<E>
      Overrides:
      add in class AbstractList<E>
    • remove

      public E remove(int anIndex)
      Remove list item.
      Specified by:
      remove in interface List<E>
      Overrides:
      remove in class AbstractList<E>
    • setAll

      public void setAll(Collection<? extends E> aCollection)
      Sets all items.
    • clear

      public void clear()
      Clears the list.
      Specified by:
      clear in interface Collection<E>
      Specified by:
      clear in interface List<E>
      Overrides:
      clear in class AbstractList<E>
    • isMultiSel

      public boolean isMultiSel()
      Returns whether list allows multiple selections.
    • setMultiSel

      public void setMultiSel(boolean aValue)
      Sets whether list allows multiple selections.
    • getSel

      public ListSel getSel()
      Returns the ListSel.
    • setSel

      public void setSel(ListSel aSel)
      Sets the ListSel.
    • isSelEmpty

      public boolean isSelEmpty()
      Returns whether selection is empty.
    • isSelIndex

      public boolean isSelIndex(int anIndex)
      Returns whether given index is selected index.
    • getSelIndex

      public int getSelIndex()
      Returns the selected index.
    • setSelIndex

      public void setSelIndex(int anIndex)
      Sets the selected index.
    • getSelIndexes

      public int[] getSelIndexes()
      Returns the selected indices.
    • setSelIndexes

      public void setSelIndexes(int[] theIndexes)
      Sets the selected index.
    • clearSel

      public void clearSel()
      Clears the selection.
    • getSelItem

      public E getSelItem()
      Returns the selected item.
    • setSelItem

      public void setSelItem(E anItem)
      Sets the selected index.
    • getSelItems

      public Object[] getSelItems()
      Returns the selected item.
    • getSelItems

      public <T> T[] getSelItems(Class<T> aClass)
      Returns the selected item.
    • setSelItems

      public void setSelItems(E[] theItems)
      Sets the selected index.
    • getIndexesForItems

      public int[] getIndexesForItems(E[] theItems)
      Returns indexes for items.
    • selectUp

      public void selectUp()
      Selects up in the list.
    • selectDown

      public void selectDown()
      Selects up in the list.
    • addPropChangeListener

      public void addPropChangeListener(PropChangeListener aLsnr)
      Add listener.
    • removePropChangeListener

      public void removePropChangeListener(PropChangeListener aLsnr)
      Remove listener.
    • firePropChange

      protected void firePropChange(String aProp, Object oldVal, Object newVal, int anIndex)
      Fires a property change for given property name, old value, new value and index.
    • firePropChange

      protected void firePropChange(PropChange aPCE)
      Fires a given property change.
    • clone

      public Object clone()
      Standard clone implementation.
      Overrides:
      clone in class Object