public abstract class Expr extends Object implements VersionProvider, LocationScopeProvider
Modifier and Type | Field and Description |
---|---|
protected static String |
KEY_JOIN |
protected List<Expr> |
mChildren |
static int |
NO_ID |
Modifier and Type | Method and Description |
---|---|
void |
addLocation(Location location) |
protected String |
addTwoWay(String uniqueKey) |
protected String |
asPackage() |
void |
assertIsInvertible() |
boolean |
canBeEvaluatedToAVariable() |
boolean |
canBeInvalidated() |
protected String |
computeChildrenKey() |
protected String |
computeUniqueKey() |
boolean |
considerElevatingConditionals(Expr justRead) |
protected abstract List<Dependency> |
constructDependencies() |
protected List<Dependency> |
constructDynamicChildrenDependencies()
Creates a dependency for each dynamic child.
|
void |
enableDirectInvalidation() |
protected abstract KCode |
generateCode(boolean expand) |
protected android.databinding.tool.expr.Expr.Node |
getAllCalculationPaths()
All flag paths that will result in calculation of this expression.
|
List<Expr> |
getChildren() |
String |
getDefaultValue() |
List<Dependency> |
getDependants() |
List<Dependency> |
getDependencies() |
int |
getId() |
BitSet |
getInvalidFlags() |
protected abstract String |
getInvertibleError() |
List<Location> |
getLocations() |
ExprModel |
getModel() |
List<Expr> |
getParents() |
protected BitSet |
getPredicateInvalidFlags() |
BitSet |
getReadSoFar() |
int |
getRequirementFlagIndex(boolean expectedOutput)
This is called w/ a dependency of mine.
|
int |
getRequirementId() |
ModelClass |
getResolvedType() |
BitSet |
getShouldReadFlags() |
BitSet |
getShouldReadFlagsWithConditionals() |
String |
getUniqueKey()
Returns a unique string key that can identify this expression.
|
int |
getVersion() |
boolean |
hasConditionalDependant()
This expression is the predicate for 1 or more ternary expressions.
|
boolean |
hasId() |
boolean |
hasNestedCannotRead() |
void |
invalidateReadFlags() |
boolean |
isBindingExpression() |
boolean |
isConditional() |
boolean |
isDynamic()
Whether the result of this expression can change or not.
|
boolean |
isEqualityCheck() |
boolean |
isObservable() |
boolean |
isRead() |
boolean |
isTwoWay() |
boolean |
isUsed() |
protected static String |
join(List<Expr> items) |
protected static String |
join(String... items) |
boolean |
markAsReadIfDone() |
void |
markFlagsAsRead(BitSet flags) |
void |
onSwappedWith(Expr existing) |
List<Location> |
provideScopeLocation() |
protected void |
resetResolvedType() |
Expr |
resolveListeners(ModelClass valueType,
Expr parent) |
Expr |
resolveTwoWayExpressions(Expr parent) |
protected abstract ModelClass |
resolveType(ModelAnalyzer modelAnalyzer) |
void |
setBindingExpression(boolean isBindingExpression) |
void |
setId(int id) |
void |
setIsUsed(boolean isUsed) |
void |
setModel(ExprModel model) |
void |
setRequirementId(int requirementId) |
void |
setTwoWay(boolean isTwoWay) |
boolean |
shouldReadNow(List<Expr> justRead)
Used by code generation
|
KCode |
toCode() |
protected KCode |
toCode(boolean expand) |
KCode |
toFullCode() |
KCode |
toInverseCode(KCode value) |
String |
toString()
Returns a string representation of the object.
|
void |
trimShouldReadFlags(BitSet bitSet) |
void |
updateExpr(ModelAnalyzer modelAnalyzer) |
public static final int NO_ID
protected static final String KEY_JOIN
public int getId()
public void setId(int id)
public void addLocation(Location location)
public ExprModel getModel()
public BitSet getInvalidFlags()
public void setBindingExpression(boolean isBindingExpression)
public boolean isBindingExpression()
public boolean canBeEvaluatedToAVariable()
public boolean isObservable()
public Expr resolveListeners(ModelClass valueType, Expr parent)
protected void resetResolvedType()
public BitSet getShouldReadFlags()
public BitSet getShouldReadFlagsWithConditionals()
public void setModel(ExprModel model)
public void setTwoWay(boolean isTwoWay)
public boolean isTwoWay()
public void onSwappedWith(Expr existing)
public boolean isDynamic()
public ModelClass getResolvedType()
protected abstract ModelClass resolveType(ModelAnalyzer modelAnalyzer)
protected abstract List<Dependency> constructDependencies()
protected List<Dependency> constructDynamicChildrenDependencies()
public final List<Dependency> getDependencies()
public List<Dependency> getDependants()
public final String getUniqueKey()
protected String computeUniqueKey()
protected final String computeChildrenKey()
public void enableDirectInvalidation()
public boolean canBeInvalidated()
public void trimShouldReadFlags(BitSet bitSet)
public boolean isConditional()
public int getRequirementId()
public void setRequirementId(int requirementId)
public int getRequirementFlagIndex(boolean expectedOutput)
public boolean hasId()
public void markFlagsAsRead(BitSet flags)
public boolean isRead()
public boolean considerElevatingConditionals(Expr justRead)
public void invalidateReadFlags()
public int getVersion()
getVersion
in interface VersionProvider
public boolean hasNestedCannotRead()
public boolean markAsReadIfDone()
public String toString()
Object
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
public BitSet getReadSoFar()
protected android.databinding.tool.expr.Expr.Node getAllCalculationPaths()
public String getDefaultValue()
protected BitSet getPredicateInvalidFlags()
public boolean isEqualityCheck()
public void setIsUsed(boolean isUsed)
public boolean isUsed()
public void updateExpr(ModelAnalyzer modelAnalyzer)
protected String asPackage()
public List<Location> provideScopeLocation()
provideScopeLocation
in interface LocationScopeProvider
public KCode toCode()
protected KCode toCode(boolean expand)
public KCode toFullCode()
protected abstract KCode generateCode(boolean expand)
public KCode toInverseCode(KCode value)
public void assertIsInvertible()
protected abstract String getInvertibleError()
public boolean hasConditionalDependant()