MCPcopy Create free account
hub / github.com/OpenSourcePhysics/osp / getObjects

Method getObjects

src/debugging/applets/ObjectManager.java:122–132  ·  view source on GitHub ↗

Gets objects of an assignable type. The collection contains objects that are assignable from the class or interface. Returns a shallow clone. @param c the type of object @return the collection

(Class<?> c)

Source from the content-addressed store, hash-verified

120 * @return the collection
121 */
122 public Collection<Object> getObjects(Class<?> c) {
123 HashMap<String, Object> map = new HashMap<String, Object>(myObjects); // clone the object map
124 Iterator<Object> it = map.values().iterator();
125 while (it.hasNext()) { // copy only the objects of the correct type
126 Object obj = it.next();
127 if (!c.isInstance(obj)) {
128 it.remove();
129 }
130 }
131 return map.values();
132 }
133
134 /**
135 * Gets the objects.

Callers

nothing calls this directly

Calls 3

removeMethod · 0.65
hasNextMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected