class WirisPlugin::Stack

Attributes

array[RW]
size[RW]

Public Class Methods

new() click to toggle source
Calls superclass method
# File lib/com/wiris/util/type/Stack.rb, line 8
def initialize()
    super()
    self.array = Array.new()
    self.size = 0
end

Public Instance Methods

empty() click to toggle source
# File lib/com/wiris/util/type/Stack.rb, line 26
def empty()
    return @size == 0
end
pop() click to toggle source
# File lib/com/wiris/util/type/Stack.rb, line 16
def pop()
    if @size > 0
        @size-=1
        @array::pop()
    end
end
push(e) click to toggle source
# File lib/com/wiris/util/type/Stack.rb, line 22
def push(e)
    @array::push(e)
    @size+=1
end
top() click to toggle source
# File lib/com/wiris/util/type/Stack.rb, line 13
def top()
    return @array::_(@size - 1)
end