[](key)
click to toggle source
def [](key)
@set[key.ident]
end
[]=(key, val)
click to toggle source
def []=(key, val)
@set[key.ident] = val
end
add(i)
click to toggle source
def add(i)
@set[i.ident] = i
end
clear()
click to toggle source
delete(key)
click to toggle source
def delete(key)
i = @set[key.ident]
@set[key.ident] = nil
i
end
dup()
click to toggle source
def dup
ISet.new(@set.dup)
end
each(&block)
click to toggle source
def each(&block)
@set.compact.each(&block)
end
empty?()
click to toggle source
def empty?
@set.nitems == 0
end
include?(key)
click to toggle source
inspect()
click to toggle source
key?(key)
click to toggle source
size()
click to toggle source
to_a()
click to toggle source
def to_a
@set.compact
end
to_s()
click to toggle source
def to_s
"[#{@set.compact.join(' ')}]"
end
update(other)
click to toggle source
def update(other)
s = @set
o = other.set
o.each_index do |idx|
if t = o[idx]
s[idx] = t
end
end
end
update_a(a)
click to toggle source
def update_a(a)
s = @set
a.each {|i| s[i.ident] = i }
end