Record Class AssignmentStatement
java.lang.Object
java.lang.Record
com.darkcollective.relix.lang.ast.AssignmentStatement
- Record Components:
exported-trueif this name is importable by other files;falsewhen theprivatemodifier is presentname- the symbol name; must not be blankbody- the right-hand side (RA expression or inline table)location- the source location of this statement; never null
- All Implemented Interfaces:
Statement
public record AssignmentStatement(boolean exported, String name, AssignmentBody body, SourceLocation location)
extends Record
implements Statement
An assignment statement — gives a name to a relational algebra expression or
an inline table.
Syntax forms:
// Named view (query assignment body)
ActiveUsers := { σ status = "active" (Users) };
// Inline Markdown table
Cities := [
| name | country |
|--------------|---------|
| Chicago, IL | US |
| London | UK |
];
// Inline CSV table
Cities := csv[
name, country
"Chicago, IL", US
London, UK
];
// Private — not importable by other files
private Temp := { σ deleted = false (RawData) };
-
Constructor Summary
ConstructorsConstructorDescriptionAssignmentStatement(boolean exported, String name, AssignmentBody body) Convenience constructor for tests; usesSourceLocation.UNKNOWN.AssignmentStatement(boolean exported, String name, AssignmentBody body, SourceLocation location) Creates an instance of aAssignmentStatementrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbody()Returns the value of thebodyrecord component.final booleanIndicates whether some other object is "equal to" this one.booleanexported()Returns the value of theexportedrecord component.final inthashCode()Returns a hash code value for this object.location()Returns the value of thelocationrecord component.name()Returns the value of thenamerecord component.static AssignmentStatementof(String name, AssignmentBody body) Creates an exported assignment (the common case).final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AssignmentStatement
public AssignmentStatement(boolean exported, String name, AssignmentBody body, SourceLocation location) Creates an instance of aAssignmentStatementrecord class. -
AssignmentStatement
Convenience constructor for tests; usesSourceLocation.UNKNOWN.
-
-
Method Details
-
of
Creates an exported assignment (the common case). -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
exported
public boolean exported()Returns the value of theexportedrecord component.- Returns:
- the value of the
exportedrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
body
Returns the value of thebodyrecord component.- Returns:
- the value of the
bodyrecord component
-
location
Returns the value of thelocationrecord component.
-