class Antlr4::Runtime::Array2DHashSet::SetIterator

Public Class Methods

new(data, parent) click to toggle source
# File lib/antlr4/runtime/array_2d_hash_set.rb, line 390
def initialize(data, parent)
  @data = data
  @parent = parent
  @next_index = 0
  @removed = true
end

Public Instance Methods

has_next() click to toggle source
# File lib/antlr4/runtime/array_2d_hash_set.rb, line 397
def has_next
  @next_index < @data.length
end
next() click to toggle source
# File lib/antlr4/runtime/array_2d_hash_set.rb, line 401
def next
  raise StandardError unless has_next

  @removed = false
  result = @data[@next_index]
  @next_index += 1
  result
end
remove() click to toggle source
# File lib/antlr4/runtime/array_2d_hash_set.rb, line 410
def remove
  raise IllegalStateException if @removed

  parent.remove(@data[@next_index - 1])
  @removed = true
end