BasicEntity¶
-
public abstract class
BasicEntity
<T> extends Entity implements Iterable<T>¶ Infrastructure class to enable the inheriting classes type-safe access to instances.
Methods¶
get¶
-
public abstract T
get
()¶ Get the instance corresponding to a scalar entity.
Throws: - UnsupportedOperationException – if the entity is not scalar.
- IllegalStateException – if the entity has been deleted in the underlying AMPL interpreter
Returns: The corresponding instance.
get¶
-
public abstract T
get
(Object... key)¶ Get the instance corresponding to the specified key. See Access to instances and values for further information on how the key can be specified.
Parameters: - key – Key of the instance to be found.
Throws: - IllegalArgumentException – if trying to access an instance with the wrong number of keys (see
Entity.indexarity
) - IllegalStateException – if the entity has been deleted in the underlying AMPL interpreter
Returns: The instance corresponding to the key, or
null
if the specified key is not found.
get¶
-
public abstract T
get
(Tuple key)¶ Get the instance corresponding to the specified tuple. See Access to instances and values for further information on how the key can be specified.
Parameters: - key – Key (in form of Tuple) of the instance to be found.
Throws: - IllegalArgumentException – if trying to access an instance with the wrong number of keys (see
Entity.indexarity
) - IllegalStateException – if the entity has been deleted in the underlying AMPL interpreter
Returns: The instance corresponding to the key, or
null
if the specified key is not found.