Sha256: 5d834909c27cb3f2dc369af5c902cd92d65d094a6cf256d6e04a42d516289aed

Contents?: true

Size: 797 Bytes

Versions: 2

Compression:

Stored size: 797 Bytes

Contents

module Alf
  module Operator::Relational
    class Minus < Alf::Operator()
      include Operator::Relational, Operator::Shortcut, Operator::Binary
      
      signature do |s|
      end
      
      class HashBased
        include Operator, Operator::Binary
      
        protected
        
        def _prepare
          @index = Hash.new
          right.each{|t| @index[t] = true}
        end
        
        def _each
          left.each do |left_tuple|
            yield(left_tuple) unless @index.has_key?(left_tuple)
          end
        end
        
      end
      
      protected
      
      # (see Shortcut#longexpr)
      def longexpr
        chain HashBased.new,
              datasets 
      end
      
    end # class Minus
  end # module Operator::Relational
end # module Alf

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
alf-0.10.1 lib/alf/operator/relational/minus.rb
alf-0.10.0 lib/alf/operator/relational/minus.rb