public final class SimpleCase extends DataObject
Constructor and Description |
---|
SimpleCase(int when, TypedExpression thenExpression)
Creates a
SimpleCase that has the specified WHEN and THEN expressions. |
SimpleCase(java.lang.String when, TypedExpression thenExpression)
Creates a
SimpleCase that has the specified WHEN and THEN expressions. |
SimpleCase(TypedExpression whenExpression, TypedExpression thenExpression)
Creates a
SimpleCase that has the specified WHEN and THEN expressions. |
Modifier and Type | Method and Description |
---|---|
TypedExpression |
getThenExpression()
Gets the
TypedExpression that resolves to the THEN expression of this SimpleCase . |
TypedExpression |
getWhenExpression()
Gets the
TypedExpression that resolves to the WHEN expression of this SimpleCase . |
boolean |
isCompositeObject()
Indicates whether this
SimpleCase contains other SyntaxObject objects. |
java.lang.Object |
visit(SyntaxObjectVisitor visitor, java.lang.Object context)
Calls the
visitSimpleCase method of the SyntaxObjectVisitor and passes that method this SimpleCase and an Object . |
equals, equals, fromSyntax, fromSyntax, fromSyntax, fromSyntax, fromSyntax, isValid, toSyntax, toSyntax, toSyntax, toSyntax, toSyntax, toSyntax
public SimpleCase(TypedExpression whenExpression, TypedExpression thenExpression)
SimpleCase
that has the specified WHEN
and THEN
expressions.whenExpression
- A TypedExpression
that resolves to a WHEN
expression for a simple case expression clause of a CASE
expression.thenExpression
- A TypedExpression
that resolves to a THEN
expression for a simple case expression clause of a CASE
expression.public SimpleCase(int when, TypedExpression thenExpression)
SimpleCase
that has the specified WHEN
and THEN
expressions.when
- An integer to use as the WHEN
expression for a simple case expression clause of a CASE
expression.thenExpression
- A TypedExpression
that resolves to a THEN
expression for a simple case expression clause of a CASE
expression.public SimpleCase(java.lang.String when, TypedExpression thenExpression)
SimpleCase
that has the specified WHEN
and THEN
expressions.when
- A String
to use as the WHEN
expression for a simple case expression clause of a CASE
expression.thenExpression
- A TypedExpression
that resolves to a THEN
expression for a simple case expression clause of a CASE
expression.public java.lang.Object visit(SyntaxObjectVisitor visitor, java.lang.Object context)
visitSimpleCase
method of the SyntaxObjectVisitor
and passes that method this SimpleCase
and an Object
.visit
in class SyntaxObject
visitor
- A SyntaxObjectVisitor
.context
- An Object
.Object
returned by the visitSimpleCase
method.public TypedExpression getWhenExpression()
TypedExpression
that resolves to the WHEN
expression of this SimpleCase
.TypedExpression
that represents the WHEN
expression of a simple case expression clause of a Case
expression.public TypedExpression getThenExpression()
TypedExpression
that resolves to the THEN
expression of this SimpleCase
.TypedExpression
that represents the THEN
expression of a simple case expression clause of a Case
expression.public boolean isCompositeObject()
SimpleCase
contains other SyntaxObject
objects. Because a SimpleCase
has at least one TypedExpression
, which is a SyntaxObject
, this method returns true
.boolean
that is true
.