Class: Java::Util::ArrayList

Inherits:
Object
  • Object
show all
Defined in:
lib/project/ext/array_list.rb

Instance Method Summary collapse

Instance Method Details

#uniqObject

REMOVE when RubyMotion adds this



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/project/ext/array_list.rb', line 4

def uniq
  if self.length <= 1
    self
  else
    h = {}
    self.each do |el|
      h[el] = nil
    end
    h.keys
  end
end

#uniq!Object

REMOVE when RubyMotion adds this



17
18
19
20
21
22
23
# File 'lib/project/ext/array_list.rb', line 17

def uniq!
  # This was failing with an array of views, TODO, check
  out = self.uniq
  self.clear
  self.addAll out
  self
end