EntityList¶
-
public class
EntityList
<E extends Entity<?>> implements List<E>¶ Represents an immutable and synchronised list of AMPL entities. It can be obtained using the functions
AMPL.getVariables
,AMPL.getConstraints
,AMPL.getSets
,AMPL.getObjectives
,AMPL.getParameters
.The collection cannot be modified by the user (entities cannot be added nor deleted) and is linked to an
AMPL
object. When the corresponding AMPL entities are modified (throughAMPL.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
AMPL
object is not running anymore, or it is null, an exception is thrown on all operations.
Constructors¶
EntityList¶
-
EntityList
(AMPL ampl, EntityType e)¶
Methods¶
add¶
-
public boolean
add
(E e)¶ Unsupported operation. Throws exception.
Throws: - UnsupportedOperationException. –
add¶
-
public void
add
(int index, E element)¶ Unsupported operation. Throws exception.
Throws: - UnsupportedOperationException. –
addAll¶
-
public boolean
addAll
(Collection<? extends E> c)¶ Unsupported operation. Throws exception.
Throws: - UnsupportedOperationException. –
addAll¶
-
public boolean
addAll
(int index, Collection<? extends E> c)¶ Unsupported operation. Throws exception.
Throws: - UnsupportedOperationException. –
clear¶
-
public void
clear
()¶ Unsupported operation. Throws exception.
Throws: - UnsupportedOperationException. –
containsAll¶
-
public boolean
containsAll
(Collection<?> c)¶ Return true if the collection contains all the items in c
get¶
-
public E
get
(String name)¶ Get an entity by name.
Parameters: - name – Name of the entity to get
Returns: The corresponding
ampl.Entity
listIterator¶
-
public ListIterator<E>
listIterator
()¶ Get the list iterator for the collection
listIterator¶
-
public ListIterator<E>
listIterator
(int index)¶ Get the list iterator for the collection, starting at index
remove¶
remove¶
-
public E
remove
(int index)¶ Unsupported operation. Throws exception.
Throws: - UnsupportedOperationException. –
removeAll¶
-
public boolean
removeAll
(Collection<?> c)¶ Unsupported operation. Throws exception.
Throws: - UnsupportedOperationException. –
retainAll¶
-
public boolean
retainAll
(Collection<?> c)¶ Unsupported operation. Throws exception.
Throws: - UnsupportedOperationException. –
set¶
-
public E
set
(int index, E element)¶ Unsupported operation. Throws exception.
Throws: - UnsupportedOperationException. –
size¶
-
public int
size
()¶ Get the number of items in the collection
See also:
java.util.List.size()