Class: Axiom::Relation::Materialized
- Inherits:
-
Axiom::Relation
- Object
- Axiom::Relation
- Axiom::Relation::Materialized
- Defined in:
- lib/axiom/relation/materialized.rb
Overview
A materialized relation
Direct Known Subclasses
Constant Summary collapse
- ZERO_TUPLE =
EMPTY_ARRAY
Instance Attribute Summary collapse
-
#directions ⇒ Operation::Sorted::DirectionSet
readonly
private
The relation sort order.
Attributes inherited from Axiom::Relation
Class Method Summary collapse
-
.new(*args) ⇒ Relation
Instantiate a materialized Relation.
Instance Method Summary collapse
-
#initialize(header, tuples, directions = Operation::Sorted::DirectionSet::EMPTY) ⇒ undefined
constructor
private
Initialize a materialized Relation.
-
#materialize ⇒ self
A noop for Materialized relations.
-
#materialized? ⇒ true
Return true for a Materialized relation.
-
#size ⇒ Integer
Return the number of tuples.
Methods inherited from Axiom::Relation
#==, #[], #each, #empty?, #include?, #replace
Methods included from Visitable
Constructor Details
#initialize(header, tuples, directions = Operation::Sorted::DirectionSet::EMPTY) ⇒ undefined
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize a materialized Relation
73 74 75 76 |
# File 'lib/axiom/relation/materialized.rb', line 73 def initialize(header, tuples, directions = Operation::Sorted::DirectionSet::EMPTY) super(header, tuples) @directions = Operation::Sorted::DirectionSet.coerce(directions) end |
Instance Attribute Details
#directions ⇒ Operation::Sorted::DirectionSet (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The relation sort order
15 16 17 |
# File 'lib/axiom/relation/materialized.rb', line 15 def directions @directions end |
Class Method Details
.new(*args) ⇒ Relation
Instantiate a materialized Relation
35 36 37 38 39 40 41 |
# File 'lib/axiom/relation/materialized.rb', line 35 def self.new(*args) if equal?(Materialized) && empty?(args[1]) Empty.new(args.first) else super end end |
Instance Method Details
#materialize ⇒ self
A noop for Materialized relations
86 87 88 |
# File 'lib/axiom/relation/materialized.rb', line 86 def materialize self end |
#materialized? ⇒ true
Return true for a Materialized relation
98 99 100 |
# File 'lib/axiom/relation/materialized.rb', line 98 def materialized? true end |
#size ⇒ Integer
Return the number of tuples
110 111 112 |
# File 'lib/axiom/relation/materialized.rb', line 110 def size tuples.size end |