Class: IntervalNotation::SweepLine::TraceState::Subtract

Inherits:
MultipleState
  • Object
show all
Defined in:
lib/interval_notation/sweep_line/trace_state/subtract.rb

Overview

Class allows to observe whether sweep line is inside of first and outside of second interval set

Instance Attribute Summary

Attributes inherited from MultipleState

#inclusion_state

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from MultipleState

#state_after_point, #state_at_point

Class Method Details

.initial_stateObject



9
10
11
# File 'lib/interval_notation/sweep_line/trace_state/subtract.rb', line 9

def self.initial_state
  self.new([false, false])
end

Instance Method Details

#state_convolutionObject



13
14
15
# File 'lib/interval_notation/sweep_line/trace_state/subtract.rb', line 13

def state_convolution
  inclusion_state[0] && !inclusion_state[1]
end