Package androidx.constraintlayout.core
Class ArrayRow
- java.lang.Object
-
- androidx.constraintlayout.core.ArrayRow
-
- Direct Known Subclasses:
GoalRow,PriorityGoalRow
public class ArrayRow extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceArrayRow.ArrayRowVariables
-
Field Summary
Fields Modifier and Type Field Description ArrayRow.ArrayRowVariablesvariables
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ArrayRowaddError(LinearSystem system, int strength)voidaddError(SolverVariable error)voidclear()ArrayRowcreateRowDimensionRatio(SolverVariable variableA, SolverVariable variableB, SolverVariable variableC, SolverVariable variableD, float ratio)Create a constraint to expressA = B + (C - D)* ratio We use this for ratio, where for exampleRight = Left + (Bottom - Top) * percentArrayRowcreateRowEqualDimension(float currentWeight, float totalWeights, float nextWeight, SolverVariable variableStartA, int marginStartA, SolverVariable variableEndA, int marginEndA, SolverVariable variableStartB, int marginStartB, SolverVariable variableEndB, int marginEndB)ArrayRowcreateRowEqualMatchDimensions(float currentWeight, float totalWeights, float nextWeight, SolverVariable variableStartA, SolverVariable variableEndA, SolverVariable variableStartB, SolverVariable variableEndB)ArrayRowcreateRowEquals(SolverVariable variable, int value)ArrayRowcreateRowEquals(SolverVariable variableA, SolverVariable variableB, int margin)ArrayRowcreateRowGreaterThan(SolverVariable a, int b, SolverVariable slack)ArrayRowcreateRowGreaterThan(SolverVariable variableA, SolverVariable variableB, SolverVariable slack, int margin)ArrayRowcreateRowLowerThan(SolverVariable variableA, SolverVariable variableB, SolverVariable slack, int margin)ArrayRowcreateRowWithAngle(SolverVariable at, SolverVariable ab, SolverVariable bt, SolverVariable bb, float angleComponent)Create a constraint to express At + (Ab-At)/2 = Bt + (Bb-Bt)/2 - angleSolverVariablegetKey()SolverVariablegetPivotCandidate(LinearSystem system, boolean[] avoid)voidinitFromRow(androidx.constraintlayout.core.LinearSystem.Row row)Used to initiate a goal from a given row (to see if we can remove an extra var)booleanisEmpty()SolverVariablepickPivot(SolverVariable exclude)voidreset()java.lang.StringtoString()voidupdateFromFinalVariable(LinearSystem system, SolverVariable variable, boolean removeFromDefinition)voidupdateFromRow(LinearSystem system, ArrayRow definition, boolean removeFromDefinition)voidupdateFromSynonymVariable(LinearSystem system, SolverVariable variable, boolean removeFromDefinition)voidupdateFromSystem(LinearSystem system)
-
-
-
Field Detail
-
variables
public ArrayRow.ArrayRowVariables variables
-
-
Constructor Detail
-
ArrayRow
public ArrayRow()
-
ArrayRow
public ArrayRow(Cache cache)
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
reset
public void reset()
-
createRowEquals
public ArrayRow createRowEquals(SolverVariable variable, int value)
-
createRowEquals
public ArrayRow createRowEquals(SolverVariable variableA, SolverVariable variableB, int margin)
-
createRowGreaterThan
public ArrayRow createRowGreaterThan(SolverVariable variableA, SolverVariable variableB, SolverVariable slack, int margin)
-
createRowGreaterThan
public ArrayRow createRowGreaterThan(SolverVariable a, int b, SolverVariable slack)
-
createRowLowerThan
public ArrayRow createRowLowerThan(SolverVariable variableA, SolverVariable variableB, SolverVariable slack, int margin)
-
createRowEqualMatchDimensions
public ArrayRow createRowEqualMatchDimensions(float currentWeight, float totalWeights, float nextWeight, SolverVariable variableStartA, SolverVariable variableEndA, SolverVariable variableStartB, SolverVariable variableEndB)
-
createRowEqualDimension
public ArrayRow createRowEqualDimension(float currentWeight, float totalWeights, float nextWeight, SolverVariable variableStartA, int marginStartA, SolverVariable variableEndA, int marginEndA, SolverVariable variableStartB, int marginStartB, SolverVariable variableEndB, int marginEndB)
-
addError
public ArrayRow addError(LinearSystem system, int strength)
-
createRowDimensionRatio
public ArrayRow createRowDimensionRatio(SolverVariable variableA, SolverVariable variableB, SolverVariable variableC, SolverVariable variableD, float ratio)
Create a constraint to expressA = B + (C - D)* ratio We use this for ratio, where for exampleRight = Left + (Bottom - Top) * percent- Parameters:
variableA- variable AvariableB- variable BvariableC- variable CvariableD- variable Dratio- ratio between AB and CD- Returns:
- the row
-
createRowWithAngle
public ArrayRow createRowWithAngle(SolverVariable at, SolverVariable ab, SolverVariable bt, SolverVariable bb, float angleComponent)
Create a constraint to express At + (Ab-At)/2 = Bt + (Bb-Bt)/2 - angle
-
isEmpty
public boolean isEmpty()
-
updateFromRow
public void updateFromRow(LinearSystem system, ArrayRow definition, boolean removeFromDefinition)
-
updateFromFinalVariable
public void updateFromFinalVariable(LinearSystem system, SolverVariable variable, boolean removeFromDefinition)
-
updateFromSynonymVariable
public void updateFromSynonymVariable(LinearSystem system, SolverVariable variable, boolean removeFromDefinition)
-
pickPivot
public SolverVariable pickPivot(SolverVariable exclude)
-
getPivotCandidate
public SolverVariable getPivotCandidate(LinearSystem system, boolean[] avoid)
-
clear
public void clear()
-
initFromRow
public void initFromRow(androidx.constraintlayout.core.LinearSystem.Row row)
Used to initiate a goal from a given row (to see if we can remove an extra var)
-
addError
public void addError(SolverVariable error)
-
getKey
public SolverVariable getKey()
-
updateFromSystem
public void updateFromSystem(LinearSystem system)
-
-