[jruby-user] jruby call method from super java class
Jochen Schreiber <[email protected]> Wed, 03 Dec 2014 20:31:07 +0100
| Newsgroups | gmane.comp.lang.jruby.user |
|---|---|
| Message-ID | <[email protected]> |
I am trying to create a subclass in jruby which overrides the keys
method from the super java class properties cause i want to sort the
entries in the properties class by the keys:
class SortedProperties < java.util.Properties
def keys
keysEnum = super().keys()
keyList = java.util.Vector.new
keysEnum.elements.each do |element|
puts element.to_s
keyList.add(element.to_java(:String))
end
java.util.Collections.sort(keyList)
puts keyList.elements().to_s
return keyList.elements()
end
end
I am doing definitly something wrong with the super statement but i
don't know what. Searched a lot but can't find anything that points me
to the correct call of the method keys() in the super class properties.
--
Posted via http://www.ruby-forum.com/.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email