java.lang.Object
java.lang.Record
com.darkcollective.relix.ast.RelationNode
- Record Components:
name- the relation name; must not be blankproduceBound- optional generator production stop; never null, possibly emptylocation- the source location of this node; never null
- All Implemented Interfaces:
RelNode
public record RelationNode(String name, Optional<ProduceBound> produceBound, SourceLocation location)
extends Record
implements RelNode
A base relation (table) reference — a leaf node in the relational algebra tree.
Example: Users refers to the relation named "Users".
produceBound() is an optional production stop folded in by the
optimizer (GEN-001) when this leaf is a monotone generator
(Naturals/Primes) under an upper-bound selection; it is always
Optional.empty() on a parsed tree and for every non-generator relation,
and never changes the output schema.
-
Constructor Summary
ConstructorsConstructorDescriptionRelationNode(String name) Convenience constructor for tests; usesSourceLocation.UNKNOWN.RelationNode(String name, SourceLocation location) Constructor without a production bound.RelationNode(String name, Optional<ProduceBound> produceBound, SourceLocation location) Creates an instance of aRelationNoderecord class. -
Method Summary
Modifier and TypeMethodDescription<R> Raccept(RelNodeVisitor<R> visitor) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.location()Returns the value of thelocationrecord component.name()Returns the value of thenamerecord component.Returns the value of theproduceBoundrecord component.final StringtoString()Returns a string representation of this record class.withProduceBound(ProduceBound bound) Returns a copy of this leaf carrying the given generator production bound.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.darkcollective.relix.ast.RelNode
children, mapChildren, materializationMode, prettyPrint
-
Constructor Details
-
RelationNode
Creates an instance of aRelationNoderecord class.- Parameters:
name- the value for thenamerecord componentproduceBound- the value for theproduceBoundrecord componentlocation- the value for thelocationrecord component
-
RelationNode
Constructor without a production bound. -
RelationNode
Convenience constructor for tests; usesSourceLocation.UNKNOWN.
-
-
Method Details
-
withProduceBound
Returns a copy of this leaf carrying the given generator production bound.- Parameters:
bound- the production stop to fold in; must not be null- Returns:
- a bounded copy, preserving name and location
-
accept
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
produceBound
Returns the value of theproduceBoundrecord component.- Returns:
- the value of the
produceBoundrecord component
-
location
Returns the value of thelocationrecord component.
-