class WirisPlugin::IntegerTools

Public Class Methods

clamp(x, a, b) click to toggle source
# File lib/com/wiris/util/type/IntegerTools.rb, line 21
def self.clamp(x, a, b)
    return IntegerTools.min(IntegerTools.max(a,x),b)
end
inRange(x, start, _end) click to toggle source
# File lib/com/wiris/util/type/IntegerTools.rb, line 24
def self.inRange(x, start, _end)
    return (x >= start) && (x < _end)
end
isInt(x) click to toggle source
# File lib/com/wiris/util/type/IntegerTools.rb, line 27
def self.isInt(x)
    return (EReg.new("[\\+\\-]?\\d+",""))::match(x)
end
max(x, y) click to toggle source
# File lib/com/wiris/util/type/IntegerTools.rb, line 15
def self.max(x, y)
    return (x > y) ? x : y
end
min(x, y) click to toggle source
# File lib/com/wiris/util/type/IntegerTools.rb, line 18
def self.min(x, y)
    return (x < y) ? x : y
end
new() click to toggle source
Calls superclass method
# File lib/com/wiris/util/type/IntegerTools.rb, line 6
def initialize()
    super()
end
sign(value) click to toggle source
# File lib/com/wiris/util/type/IntegerTools.rb, line 9
def self.sign(value)
    return (value >= 0) ? 1 : -1
end
signBool(value) click to toggle source
# File lib/com/wiris/util/type/IntegerTools.rb, line 12
def self.signBool(value)
    return value ? 1 : -1
end