Class: Contrek::Concurrent::Sequence

Inherits:
Object
  • Object
show all
Includes:
Queueable
Defined in:
lib/contrek/finder/concurrent/sequence.rb

Instance Attribute Summary collapse

Attributes included from Queueable

#head, #size, #tail

Instance Method Summary collapse

Methods included from Queueable

#add, #each, #forward!, #initialize, #iterator, #map, #move_from, #next_of!, #pop!, #rem, #reverse_each, #rewind!, #to_a

Instance Attribute Details

#shapeObject

Returns the value of attribute shape.



6
7
8
# File 'lib/contrek/finder/concurrent/sequence.rb', line 6

def shape
  @shape
end

Instance Method Details

#get_vector_cacheObject



20
21
22
# File 'lib/contrek/finder/concurrent/sequence.rb', line 20

def get_vector_cache
  @vector_cache ||= to_a
end

#is_not_verticalObject



9
10
11
12
13
14
15
16
17
18
# File 'lib/contrek/finder/concurrent/sequence.rb', line 9

def is_not_vertical
  return false if size < 2
  x0 = head.payload[:x]
  rewind!
  while (position = iterator)
    return true if position.payload[:x] != x0
    forward!
  end
  false
end