Class: Wiris::ArrayInt

Inherits:
Array
  • Object
show all
Defined in:
lib/src-generic/ArrayInt.rb

Instance Method Summary collapse

Instance Method Details

#_(i, e = nil) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/src-generic/ArrayInt.rb', line 24

def _(i, e=nil)
	if e.nil?
		return get(i)
	else
		self[i] = e
	end
end

#get(i) ⇒ Object



20
21
22
# File 'lib/src-generic/ArrayInt.rb', line 20

def get(i)
		return self[i]
end

#sortObject



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/src-generic/ArrayInt.rb', line 3

def sort()
	for i in 1..length()
		j = i
		b = get(i)
		while ((j>0) && get(j-1) > b)
			insert(j,get(j-1))
			j -=1
		end
		insert(j, b)
		i += 1
	end
end

#splice(i, len) ⇒ Object



16
17
18
# File 'lib/src-generic/ArrayInt.rb', line 16

def splice(i, len)
	na = slice!(i, len)
end