I'm currently using Rhino to run JavaScript code within my Java program, but I've encountered a problem with iterating over the map in JavaScript.
On the Java side:
private final Map<Long, ClassEmployees > employees ;
...
employees.put (numEmployees, new ClassEmployees());
...
On the JavaScript side:
keys = employees.keySet();
for (var i in keys) {
print ("++ " + i); // ===> why is this printing methods?
}
Output :
++ getClass
++ iterator
++ toArray
++ addAll
++ remove
++ equals
++ containsAll
++ class
++ hashCode
++ contains
++ wait
++ add
++ size
++ clear
++ isEmpty
++ notify
++ empty
++ retainAll
++ toString
++ notifyAll
++ removeAll