Class: Locomotive::RelationalAlgebra::ThetaJoin

Inherits:
Join show all
Defined in:
lib/locomotive/relational_algebra/operators/join/theta_join.rb

Instance Attribute Summary collapse

Attributes inherited from Operator

#schema

Attributes included from AstHelpers::AstNode

#kind, #left_child, #owner, #right_child, #value

Instance Method Summary collapse

Methods inherited from Operator

#bound, #free, #to_xml, #xml_kind, #xml_schema

Methods included from XML

included, #quote, #to_xml

Methods included from AstHelpers::Annotations

#method_missing, #respond_to?

Methods included from AstHelpers::AstNode

#has_left_child?, #has_right_child?, #is_leaf?, #traverse, #traverse_strategy=

Constructor Details

#initialize(op1, op2, pred_list) ⇒ ThetaJoin

Returns a new instance of ThetaJoin.



21
22
23
24
# File 'lib/locomotive/relational_algebra/operators/join/theta_join.rb', line 21

def initialize(op1, op2, pred_list)
  self.predicate_list = to_predicate_list pred_list
  super(op1,op2)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Locomotive::AstHelpers::Annotations

Instance Attribute Details

#predicate_listObject

Returns the value of attribute predicate_list.



18
19
20
# File 'lib/locomotive/relational_algebra/operators/join/theta_join.rb', line 18

def predicate_list
  @predicate_list
end

Instance Method Details

#cloneObject



37
38
39
40
41
# File 'lib/locomotive/relational_algebra/operators/join/theta_join.rb', line 37

def clone
  ThetaJoin.new(left.clone,
                right.clone,
                predicate_list.clone)
end

#left_and_right(op1, op2) ⇒ Object



26
27
28
29
# File 'lib/locomotive/relational_algebra/operators/join/theta_join.rb', line 26

def left_and_right(op1,op2)
  self.schema = op1.schema + op2.schema
  super(op1,op2)
end

#set(var, plan) ⇒ Object



43
44
45
46
47
48
# File 'lib/locomotive/relational_algebra/operators/join/theta_join.rb', line 43

def set(var,plan)
  ThetaJoin.new(
    left.set(var,plan),
    right.set(var,plan),
    predicate_list.clone)
end

#xml_contentObject



31
32
33
34
35
# File 'lib/locomotive/relational_algebra/operators/join/theta_join.rb', line 31

def xml_content
  content do
    predicate_list.to_xml
  end
end