public final class IntegerNode extends AbstractExprNode
Important: Do not use outside of Soy code (treat as superpackage-private).
ExprNode.Kind, ExprNode.OperatorNode, ExprNode.ParentExprNode, ExprNode.PrimitiveNode| Constructor and Description |
|---|
IntegerNode(long value,
SourceLocation sourceLocation) |
| Modifier and Type | Method and Description |
|---|---|
IntegerNode |
copy(CopyState copyState)
See
Node.copy(CopyState) for a description of the copy contract. |
ExprNode.Kind |
getKind()
Gets this node's kind (corresponding to this node's specific type).
|
IntType |
getType()
Gets the data type of this node.
|
long |
getValue()
Returns the Soy integer value.
|
static boolean |
isInRange(long value)
Returns true if
value is within JavaScript safe range. |
boolean |
isInt()
Returns true if the value stored by the node is a 32-bit integer.
|
String |
toSourceString()
Builds a Soy source string that could be the source for this node.
|
getParent, getSourceLocationcouldHaveSyntaxVersionAtLeast, equals, getNearestAncestor, getSyntaxVersionUpperBound, hasAncestor, hashCode, maybeSetSyntaxVersionUpperBound, setParent, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitcouldHaveSyntaxVersionAtLeast, getNearestAncestor, getSourceLocation, getSyntaxVersionUpperBound, hasAncestor, maybeSetSyntaxVersionUpperBound, setParentpublic IntegerNode(long value,
SourceLocation sourceLocation)
value - The Soy integer value.sourceLocation - The node's source location.public static boolean isInRange(long value)
value is within JavaScript safe range.public ExprNode.Kind getKind()
ExprNodepublic IntType getType()
ExprNodepublic long getValue()
public boolean isInt()
public String toSourceString()
NodeNote: Some nodes do not have a direct mapping to Soy source (such as nodes created during some optimization passes). Thus this method may not always be supported.
public IntegerNode copy(CopyState copyState)
ExprNodeNode.copy(CopyState) for a description of the copy contract.