Class AbstractProtectedList<T extends ISimpleElement>

java.lang.Object
org.scictrl.mp.orbitcorrect.model.optics.AbstractProtectedList<T>
Type Parameters:
T - elements type
Direct Known Subclasses:
AbstractProtectedMagnetList, BindedList, BPMonitorList, DispersionDataList, OpticsList, PositionedDataList, PowerSupplyList, TransferList

public abstract class AbstractProtectedList<T extends ISimpleElement> extends Object
Abstract list for holding DataBush elements in DataBush. Implements basic behaviour for all cast-save readonly lists. This list is backed upon DoubleList.
Author:
igor@scictrl.com
  • Field Details

  • Method Details

    • contains

      public boolean contains(Object o)
      Returns true if this list contains the specified element.
      Parameters:
      o - a Object element whose presence in this List is to be tested.
      Returns:
      returns true if list contains element o, false otherwise.
    • getOwner

      public DataBush getOwner()
      Returns DataBush that owns this list.
      Returns:
      a DataBush owner of this list
    • isEmpty

      public boolean isEmpty()
      Tests if this list has no elements.
      Returns:
      true if this list has no elements, false otherwise.
    • size

      public int size()
      Returns the number of elements in this list.
      Returns:
      the number of elements in this list
    • toArray

      public AbstractDataBushElement[] toArray()
      Returns an array containing all of the elements in this list in the correct order.
      Returns:
      an array of AbstractDataBushElement an array containing all of the elements in this list in the correct order
    • toElementList

      public ElementList<?> toElementList()

      toElementList.

      Returns:
      a ElementList object
    • toString

      public String toString()
      Returns a string representation of the object. Returns string representation of all contained elements (calls toString() on each) in correct order seperated by EOL sequence.
      Overrides:
      toString in class Object
    • get

      public T get(int i)

      get.

      Parameters:
      i - a int
      Returns:
      a T object
    • get

      public T get(String name)

      get.

      Parameters:
      name - a String object
      Returns:
      a T object
    • add

      public boolean add(T a)

      add.

      Parameters:
      a - a T object
      Returns:
      a boolean
    • iterator

      public Iterator<T> iterator()
      This method returns HorCorrectorIterator of the elements in the list. Iteraotr starts at the begining.
      Returns:
      a Iterator object
    • iterator

      public Iterator<T> iterator(int index)
      This method returns HorCorrectorIterator of the elements in the list. Iteraotr starts at the element with position index in list.
      Parameters:
      index - a int
      Returns:
      a Iterator object
    • iterator

      public Iterator<T> iterator(HorCorrector element)
      This method returns HorCorrectorIterator of the elements in the list. Iteraotr starts at the element, which is specified as parameter.
      Parameters:
      element - a HorCorrector object
      Returns:
      a Iterator object