public class ArrayLinkedVariables extends java.lang.Object implements ArrayRow.ArrayRowVariables
| Modifier and Type | Method and Description |
|---|---|
void |
add(SolverVariable variable,
float value,
boolean removeFromDefinition)
Add value to an existing variable
The code is broadly identical to the put() method, only differing
in in-line deletion, and of course doing an add rather than a put
|
void |
clear()
Clear the list of variables
|
boolean |
contains(SolverVariable variable)
Returns true if the variable is contained in the list
|
void |
display() |
void |
divideByAmount(float amount)
Divide the values of all the variables in the list
by the given amount
|
float |
get(SolverVariable v)
Return the value of a variable, 0 if not found
|
int |
getCurrentSize() |
int |
getHead() |
int |
getId(int index) |
int |
getNextIndice(int index) |
float |
getValue(int index) |
SolverVariable |
getVariable(int index)
Return a variable from its position in the linked list
|
float |
getVariableValue(int index)
Return the value of a variable from its position in the linked list
|
int |
indexOf(SolverVariable variable) |
void |
invert()
Invert the values of all the variables in the list
|
void |
put(SolverVariable variable,
float value)
Insert a variable with a given value in the linked list
|
float |
remove(SolverVariable variable,
boolean removeFromDefinition)
Remove a variable from the list
|
int |
sizeInBytes() |
java.lang.String |
toString()
Returns a string representation of the list
|
float |
use(ArrayRow definition,
boolean removeFromDefinition)
Update the current list with a new definition
|
protected final Cache mCache
public final void put(SolverVariable variable, float value)
put in interface ArrayRow.ArrayRowVariablesvariable - the variable to add in the listvalue - the value of the variablepublic void add(SolverVariable variable, float value, boolean removeFromDefinition)
add in interface ArrayRow.ArrayRowVariablesvariable - the variable we want to addvalue - its valueremoveFromDefinition - public float use(ArrayRow definition, boolean removeFromDefinition)
use in interface ArrayRow.ArrayRowVariablesdefinition - the row containing the definitionremoveFromDefinition - public final float remove(SolverVariable variable, boolean removeFromDefinition)
remove in interface ArrayRow.ArrayRowVariablesvariable - the variable we want to removeremoveFromDefinition - public final void clear()
clear in interface ArrayRow.ArrayRowVariablespublic boolean contains(SolverVariable variable)
contains in interface ArrayRow.ArrayRowVariablesvariable - the variable we are looking forpublic int indexOf(SolverVariable variable)
indexOf in interface ArrayRow.ArrayRowVariablespublic void invert()
invert in interface ArrayRow.ArrayRowVariablespublic void divideByAmount(float amount)
divideByAmount in interface ArrayRow.ArrayRowVariablesamount - amount to divide bypublic int getHead()
public int getCurrentSize()
getCurrentSize in interface ArrayRow.ArrayRowVariablespublic final int getId(int index)
public final float getValue(int index)
public final int getNextIndice(int index)
public SolverVariable getVariable(int index)
getVariable in interface ArrayRow.ArrayRowVariablesindex - the index of the variable we want to returnpublic float getVariableValue(int index)
getVariableValue in interface ArrayRow.ArrayRowVariablesindex - the index of the variable we want to look uppublic final float get(SolverVariable v)
get in interface ArrayRow.ArrayRowVariablesv - the variable we are looking uppublic int sizeInBytes()
sizeInBytes in interface ArrayRow.ArrayRowVariablespublic void display()
display in interface ArrayRow.ArrayRowVariablespublic java.lang.String toString()
toString in class java.lang.Object