Package androidx.constraintlayout.core
Class SolverVariable
- java.lang.Object
-
- androidx.constraintlayout.core.SolverVariable
-
- All Implemented Interfaces:
java.lang.Comparable<SolverVariable>
public class SolverVariable extends java.lang.Object implements java.lang.Comparable<SolverVariable>
Represents a given variable used in thelinear expression solver.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSolverVariable.TypeType of variables
-
Field Summary
Fields Modifier and Type Field Description floatcomputedValueintidbooleaninGoalbooleanisFinalValueintstrengthstatic intSTRENGTH_BARRIERstatic intSTRENGTH_CENTERINGstatic intSTRENGTH_EQUALITYstatic intSTRENGTH_FIXEDstatic intSTRENGTH_HIGHstatic intSTRENGTH_HIGHESTstatic intSTRENGTH_LOWstatic intSTRENGTH_MEDIUMstatic intSTRENGTH_NONEintusageInRowCount
-
Constructor Summary
Constructors Constructor Description SolverVariable(SolverVariable.Type type, java.lang.String prefix)SolverVariable(java.lang.String name, SolverVariable.Type type)Base constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddToRow(ArrayRow row)intcompareTo(SolverVariable v)java.lang.StringgetName()Accessor for the namevoidremoveFromRow(ArrayRow row)voidreset()voidsetFinalValue(LinearSystem system, float value)voidsetName(java.lang.String name)voidsetSynonym(LinearSystem system, SolverVariable synonymVariable, float value)voidsetType(SolverVariable.Type type, java.lang.String prefix)java.lang.StringtoString()Override the toString() method to display the variablevoidupdateReferencesWithNewDefinition(LinearSystem system, ArrayRow definition)
-
-
-
Field Detail
-
STRENGTH_NONE
public static final int STRENGTH_NONE
- See Also:
- Constant Field Values
-
STRENGTH_LOW
public static final int STRENGTH_LOW
- See Also:
- Constant Field Values
-
STRENGTH_MEDIUM
public static final int STRENGTH_MEDIUM
- See Also:
- Constant Field Values
-
STRENGTH_HIGH
public static final int STRENGTH_HIGH
- See Also:
- Constant Field Values
-
STRENGTH_HIGHEST
public static final int STRENGTH_HIGHEST
- See Also:
- Constant Field Values
-
STRENGTH_EQUALITY
public static final int STRENGTH_EQUALITY
- See Also:
- Constant Field Values
-
STRENGTH_BARRIER
public static final int STRENGTH_BARRIER
- See Also:
- Constant Field Values
-
STRENGTH_CENTERING
public static final int STRENGTH_CENTERING
- See Also:
- Constant Field Values
-
STRENGTH_FIXED
public static final int STRENGTH_FIXED
- See Also:
- Constant Field Values
-
inGoal
public boolean inGoal
-
id
public int id
-
strength
public int strength
-
computedValue
public float computedValue
-
isFinalValue
public boolean isFinalValue
-
usageInRowCount
public int usageInRowCount
-
-
Constructor Detail
-
SolverVariable
public SolverVariable(java.lang.String name, SolverVariable.Type type)Base constructor- Parameters:
name- the variable nametype- the type of the variable
-
SolverVariable
public SolverVariable(SolverVariable.Type type, java.lang.String prefix)
-
-
Method Detail
-
addToRow
public final void addToRow(ArrayRow row)
-
removeFromRow
public final void removeFromRow(ArrayRow row)
-
updateReferencesWithNewDefinition
public final void updateReferencesWithNewDefinition(LinearSystem system, ArrayRow definition)
-
setFinalValue
public void setFinalValue(LinearSystem system, float value)
-
setSynonym
public void setSynonym(LinearSystem system, SolverVariable synonymVariable, float value)
-
reset
public void reset()
-
getName
public java.lang.String getName()
Accessor for the name- Returns:
- the name of the variable
-
setName
public void setName(java.lang.String name)
-
setType
public void setType(SolverVariable.Type type, java.lang.String prefix)
-
compareTo
public int compareTo(SolverVariable v)
- Specified by:
compareToin interfacejava.lang.Comparable<SolverVariable>
-
toString
public java.lang.String toString()
Override the toString() method to display the variable- Overrides:
toStringin classjava.lang.Object
-
-