Instance ======== .. java:package:: com.ampl :noindex: .. java:type:: public abstract class Instance> Represent an instance of a modelling entity :param : Type of the father entity Fields ------ entity ^^^^^^ .. java:field:: protected T entity :outertype: Instance hasData ^^^^^^^ .. java:field:: protected boolean hasData :outertype: Instance key ^^^ .. java:field:: protected Object key :outertype: Instance Constructors ------------ Instance ^^^^^^^^ .. java:constructor:: Instance(T entity, Object key) :outertype: Instance Default constructor :throws NullPointerException: if entity is null Methods ------- checkValidity ^^^^^^^^^^^^^ .. java:method:: protected void checkValidity() :outertype: Instance To be executed when accessing properties, throws IllegalStateException if the instance has been deleted copyFrom ^^^^^^^^ .. java:method:: abstract void copyFrom(Instance from) :outertype: Instance entity ^^^^^^ .. java:method:: public T entity() :outertype: Instance :return: Get the algebraic entity this instance is part of getDoubleSuffix ^^^^^^^^^^^^^^^ .. java:method:: protected double getDoubleSuffix(String suffix) :outertype: Instance getIntegerIndex ^^^^^^^^^^^^^^^ .. java:method:: int getIntegerIndex() :outertype: Instance If this entity is indexed over an integer index, returns the index number of the entity :throws NumberFormatException: if the index is not an integer, or if if is not just one index :return: The indexing number getIntegerIndex ^^^^^^^^^^^^^^^ .. java:method:: static int getIntegerIndex(Object index) :outertype: Instance getIntegerIndices ^^^^^^^^^^^^^^^^^ .. java:method:: int[] getIntegerIndices() :outertype: Instance If this entity is indexed over a set of integer indices, returns the index number of the entity :throws NumberFormatException: if the index is not a set of integers :return: The indexing numbers getIntegerIndices ^^^^^^^^^^^^^^^^^ .. java:method:: static int[] getIntegerIndices(Object index) :outertype: Instance getStringSuffix ^^^^^^^^^^^^^^^ .. java:method:: protected String getStringSuffix(String suffix) :outertype: Instance hasData ^^^^^^^ .. java:method:: boolean hasData() :outertype: Instance :return: True if the instance has data initialised invalidate ^^^^^^^^^^ .. java:method:: void invalidate() :outertype: Instance isValid ^^^^^^^ .. java:method:: boolean isValid() :outertype: Instance Flag that specifies if the instance has been deleted or not name ^^^^ .. java:method:: static String name(Entity entity, Object key) :outertype: Instance name ^^^^ .. java:method:: public String name() :outertype: Instance :return: The instance's name setHasData ^^^^^^^^^^ .. java:method:: protected void setHasData(boolean hasData) :outertype: Instance toString ^^^^^^^^ .. java:method:: @Override public String toString() :outertype: Instance Returns a string representation of the instance. For constraints and objective instances it is equivalent to the AMPL statement: .. parsed-literal:: expand instanceName; For set and variable instances see the documentation for the specific class.