Package org.basex.query.value.type
Enum Class Occ
- All Implemented Interfaces:
Serializable,Comparable<Occ>,java.lang.constant.Constable
Occurrence indicator (cardinality).
- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionExactly one.One or more.Zero.Zero or more.Zero or one. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionAdds two occurrence indicators.booleancheck(long card) Checks if the given cardinality is supported by this type.booleaninstanceOf(Occ occ) Checks if the specified occurrence indicator is an instance of the current occurrence indicator.Computes the intersection between this occurrence indicator and the given one.toString()Computes the union between this occurrence indicator and the given one.static OccReturns the enum constant of this class with the specified name.static Occ[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ZERO
Zero. -
ZERO_OR_ONE
Zero or one. -
EXACTLY_ONE
Exactly one. -
ONE_OR_MORE
One or more. -
ZERO_OR_MORE
Zero or more.
-
-
Field Details
-
min
public final long minMinimal result size (0or more). -
max
public final long maxMaximal result size (equal tominor more).
-
-
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
-
instanceOf
Checks if the specified occurrence indicator is an instance of the current occurrence indicator.- Parameters:
occ- occurrence indicator to check- Returns:
- result of check
-
intersect
Computes the intersection between this occurrence indicator and the given one. If none exists (e.g. betweenZEROandEXACTLY_ONE),nullis returned.- Parameters:
other- other occurrence indicator- Returns:
- intersection or
null
-
union
Computes the union between this occurrence indicator and the given one.- Parameters:
other- other occurrence indicator- Returns:
- union
-
add
Adds two occurrence indicators.- Parameters:
other- other occurrence indicator- Returns:
- union
-
check
public boolean check(long card) Checks if the given cardinality is supported by this type.- Parameters:
card- cardinality- Returns:
- result of check
-
toString
-