Package net.hydromatic.morel.ast
Class Core.NamedPat
java.lang.Object
net.hydromatic.morel.ast.AstNode
net.hydromatic.morel.ast.Core.BaseNode
net.hydromatic.morel.ast.Core.Pat
net.hydromatic.morel.ast.Core.NamedPat
- All Implemented Interfaces:
Comparable<Core.NamedPat>
- Direct Known Subclasses:
Core.AsPat,Core.IdPat
- Enclosing class:
Core
Base class for named patterns (
Core.IdPat and Core.AsPat).
Implements Comparable so that names are sorted correctly
for record fields (see RecordType.ORDERING).
A Core.ValDecl must be one of these.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal intfinal Stringstatic final com.google.common.collect.Ordering<Core.NamedPat> Ordering that compares named patterns by their names, then by their ordinal. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Core.NamedPatAccepts a shuttle, calling theShuttle.visit(net.hydromatic.morel.ast.Ast.Literal)method appropriate to the type of this node, and returning the result.(package private) static intcompare(Core.NamedPat o1, Core.NamedPat o2) Helper forORDERING.intabstract Core.NamedPatMethods inherited from class net.hydromatic.morel.ast.Core.BaseNode
accept
-
Field Details
-
ORDERING
Ordering that compares named patterns by their names, then by their ordinal. -
name
-
i
public final int i
-
-
Constructor Details
-
NamedPat
-
-
Method Details
-
compareTo
Collate first on name, then on ordinal.
- Specified by:
compareToin interfaceComparable<Core.NamedPat>
-
compare
Helper forORDERING. -
withType
-
accept
Description copied from class:AstNodeAccepts a shuttle, calling theShuttle.visit(net.hydromatic.morel.ast.Ast.Literal)method appropriate to the type of this node, and returning the result.
-