Class AiccPrerequisiteToken
java.lang.Object
dev.jcputney.elearning.parser.input.aicc.prereq.AiccPrerequisiteToken
- All Implemented Interfaces:
Serializable
Represents a token parsed from an AICC prerequisite expression. Each token has a specific type
that determines its role in the expression, such as an identifier, operator, or parenthesis.
The token optionally supports additional characteristics, such as being optional or unary, to further describe its behavior and usage within the expression.
Instances of this class are immutable and thread-safe.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAiccPrerequisiteToken(AiccPrerequisiteTokenType type, String value) Constructs an AiccPrerequisiteToken with the specified type and value.AiccPrerequisiteToken(AiccPrerequisiteTokenType type, String value, boolean optional, boolean unary) Constructs an AiccPrerequisiteToken with the specified type, value, optional, and unary attributes. -
Method Summary
Modifier and TypeMethodDescriptionbooleangetType()Retrieves the token type of this AICC prerequisite token.getValue()Retrieves the value of this object.inthashCode()booleanIndicates whether this token is optional.booleanisUnary()Indicates whether this token is a unary token.toString()
-
Constructor Details
-
AiccPrerequisiteToken
Constructs an AiccPrerequisiteToken with the specified type and value. The optional and unary attributes default to false.- Parameters:
type- the type of the AICC prerequisite token, represented asAiccPrerequisiteTokenType. It must not be null.value- the value of the AICC prerequisite token, which may be null or a string representing a learning object, literal value, or other token-related content.
-
AiccPrerequisiteToken
public AiccPrerequisiteToken(AiccPrerequisiteTokenType type, String value, boolean optional, boolean unary) Constructs an AiccPrerequisiteToken with the specified type, value, optional, and unary attributes.- Parameters:
type- the type of the AICC prerequisite token, represented asAiccPrerequisiteTokenType. It must not be null.value- the value of the AICC prerequisite token, which may be null or a string representing a learning object, literal value, or other token-related content.optional- a boolean value indicating whether the token is optional. If true, the token is optional; otherwise, it is required.unary- a boolean value indicating whether the token is unary. If true, the token is unary; otherwise, it is not.
-
-
Method Details
-
getType
Retrieves the token type of this AICC prerequisite token.- Returns:
- the type of the AICC prerequisite token, represented as an
AiccPrerequisiteTokenType.
-
getValue
Retrieves the value of this object.- Returns:
- a string representing the value of this object, or null if no value is assigned.
-
isOptional
public boolean isOptional()Indicates whether this token is optional.- Returns:
- true if the token is optional, false otherwise
-
isUnary
public boolean isUnary()Indicates whether this token is a unary token.- Returns:
- true if the token is unary, false otherwise
-
equals
-
hashCode
public int hashCode() -
toString
-