.. java:import:: java.util ArrayList .. java:import:: java.util Collection .. java:import:: java.util Iterator .. java:import:: java.util List .. java:import:: java.util ListIterator .. java:import:: java.util Map EntityList ========== .. java:package:: com.ampl :noindex: .. java:type:: public class EntityList> implements List Represents an immutable and synchronised list of AMPL entities. It can be obtained using the functions :java:ref:`AMPL.getVariables`, :java:ref:`AMPL.getConstraints`, :java:ref:`AMPL.getSets`, :java:ref:`AMPL.getObjectives`, :java:ref:`AMPL.getParameters`. The collection cannot be modified by the user (entities cannot be added nor deleted) and is linked to an :java:ref:`AMPL` object. When the corresponding AMPL entities are modified (through :java:ref:`AMPL.eval` or any other operation which influences the number of entities), the collection is automatically invalidated. It is updated lazily at the next access. If the corresponding :java:ref:`AMPL` object is not running anymore, or it is null, an exception is thrown on all operations. Fields ------ ampl ^^^^ .. java:field:: AMPL ampl :outertype: EntityList e ^ .. java:field:: EntityType e :outertype: EntityList Constructors ------------ EntityList ^^^^^^^^^^ .. java:constructor:: EntityList(AMPL ampl, EntityType e) :outertype: EntityList Methods ------- add ^^^ .. java:method:: @Deprecated @Override public boolean add(E e) :outertype: EntityList Unsupported operation. Throws exception. :throws UnsupportedOperationException.: add ^^^ .. java:method:: @Deprecated @Override public void add(int index, E element) :outertype: EntityList Unsupported operation. Throws exception. :throws UnsupportedOperationException.: addAll ^^^^^^ .. java:method:: @Deprecated @Override public boolean addAll(Collection c) :outertype: EntityList Unsupported operation. Throws exception. :throws UnsupportedOperationException.: addAll ^^^^^^ .. java:method:: @Deprecated @Override public boolean addAll(int index, Collection c) :outertype: EntityList Unsupported operation. Throws exception. :throws UnsupportedOperationException.: clear ^^^^^ .. java:method:: @Deprecated @Override public void clear() :outertype: EntityList Unsupported operation. Throws exception. :throws UnsupportedOperationException.: contains ^^^^^^^^ .. java:method:: @Override public boolean contains(Object o) :outertype: EntityList Return true if the collection contains the element o containsAll ^^^^^^^^^^^ .. java:method:: @Override public boolean containsAll(Collection c) :outertype: EntityList Return true if the collection contains all the items in c get ^^^ .. java:method:: public E get(String name) :outertype: EntityList Get an entity by name. :param name: Name of the entity to get :return: The corresponding :java:ref:`ampl.Entity` get ^^^ .. java:method:: @Override public E get(int index) :outertype: EntityList Get the item at the specified index indexOf ^^^^^^^ .. java:method:: @Override public int indexOf(Object o) :outertype: EntityList Get the index of the specified object isEmpty ^^^^^^^ .. java:method:: @Override public boolean isEmpty() :outertype: EntityList Return true if the collection is empty iterator ^^^^^^^^ .. java:method:: @Override public Iterator iterator() :outertype: EntityList Get the iterator for the collection lastIndexOf ^^^^^^^^^^^ .. java:method:: @Override public int lastIndexOf(Object o) :outertype: EntityList Get the last index of the object o listIterator ^^^^^^^^^^^^ .. java:method:: @Override public ListIterator listIterator() :outertype: EntityList Get the list iterator for the collection listIterator ^^^^^^^^^^^^ .. java:method:: @Override public ListIterator listIterator(int index) :outertype: EntityList Get the list iterator for the collection, starting at index remove ^^^^^^ .. java:method:: @Deprecated @Override public boolean remove(Object o) :outertype: EntityList Unsupported operation. Throws exception. :throws UnsupportedOperationException.: remove ^^^^^^ .. java:method:: @Deprecated @Override public E remove(int index) :outertype: EntityList Unsupported operation. Throws exception. :throws UnsupportedOperationException.: removeAll ^^^^^^^^^ .. java:method:: @Deprecated @Override public boolean removeAll(Collection c) :outertype: EntityList Unsupported operation. Throws exception. :throws UnsupportedOperationException.: retainAll ^^^^^^^^^ .. java:method:: @Deprecated @Override public boolean retainAll(Collection c) :outertype: EntityList Unsupported operation. Throws exception. :throws UnsupportedOperationException.: set ^^^ .. java:method:: @Deprecated @Override public E set(int index, E element) :outertype: EntityList Unsupported operation. Throws exception. :throws UnsupportedOperationException.: size ^^^^ .. java:method:: @Override public int size() :outertype: EntityList Get the number of items in the collection **See also:** :java:ref:`java.util.List.size()` subList ^^^^^^^ .. java:method:: @Deprecated @Override public List subList(int fromIndex, int toIndex) :outertype: EntityList Unsupported operation. Throws exception. :throws UnsupportedOperationException.: toArray ^^^^^^^ .. java:method:: @Override public Object[] toArray() :outertype: EntityList Return an array containing the elements in the collection. NOTE that the array will not be immutable and consistency with the underlying AMPL entities is not guaranteed. toArray ^^^^^^^ .. java:method:: @Override public T[] toArray(T[] a) :outertype: EntityList Return an array containing the elements in the collection. NOTE that the array will not be immutable and consistency with the underlying AMPL entities is not guaranteed. toString ^^^^^^^^ .. java:method:: @Override public String toString() :outertype: EntityList Return a string representation of this list of entities