Package org.basex.query.var
Enum Class VarUsage
- All Implemented Interfaces:
Serializable,Comparable<VarUsage>,java.lang.constant.Constable
A tri-state encoding the number of usages of a variable or context reference.
- Author:
- BaseX Team 2005-21, BSD License, Leo Woerteler
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionMore than one usage.No usages.Exactly one usage. -
Method Summary
Modifier and TypeMethodDescriptionCombines the usages for two alternative branches.static VarUsageChecks how often a variable or context reference is used in any of the given expressions.Combines the usages for two expressions that are both executed.static VarUsageChecks how often a variable or context reference is accessed in all of the given expressions.times(long count) Number of usages if the code is executedcounttimes.static VarUsageReturns the enum constant of this class with the specified name.static VarUsage[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NEVER
No usages. -
ONCE
Exactly one usage. -
MORE_THAN_ONCE
More than one usage.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
max
Combines the usages for two alternative branches.- Parameters:
other- usage count to be combined- Returns:
- number of usages for the disjunction of both branches
-
plus
Combines the usages for two expressions that are both executed.- Parameters:
other- usage count to be combined- Returns:
- number of usages of both expressions combined
-
times
Number of usages if the code is executedcounttimes.- Parameters:
count- number of executions, may be-1if not known- Returns:
- number of usages
-
sum
Checks how often a variable or context reference is accessed in all of the given expressions.- Parameters:
var- variable (Varreference) or context (null) to inlineexprs- expressions- Returns:
- number of accesses to the variable in all expressions combined
-
maximum
Checks how often a variable or context reference is used in any of the given expressions.- Parameters:
var- variable (Varreference) or context (null) to inlineexprs- expressions- Returns:
- maximum number of accesses in any given expression
-