public class ModelComponentMap extends java.lang.Object implements java.util.Map<OpenSimObject,ModelComponent>
Constructor and Description |
---|
ModelComponentMap() |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
java.util.Set<java.util.Map.Entry<OpenSimObject,ModelComponent>> |
entrySet() |
<O extends OpenSimObject> |
findObjectByName(java.lang.Class<O> baseClass,
java.lang.String name)
Finds the first instance of an object assignable to baseClass with the provided name
|
OpenSimObject |
findObjectByName(java.lang.String name)
Finds the first instance of an object with the provided name
|
OpenSimObject |
findObjectByPath(OpenSimObject obj,
java.lang.String path)
Returns a component by its fully qualified path
|
<O extends OpenSimObject> |
findObjectByPathOrName(java.lang.Class<O> baseClass,
OpenSimObject ref,
java.lang.String pathOrName)
Finds the first instance of an object assignable to baseClass with the provided path
or name
|
ModelComponent |
get(java.lang.Object key) |
ModelComponent |
get(OpenSimObject obj)
Gets a model component by OpenSimObject
|
BodySet |
getBodySet()
Returns the body set, if present
|
JointSet |
getJointSet()
Returns the joint set, if present
|
boolean |
isEmpty() |
java.util.Set<OpenSimObject> |
keySet() |
ModelComponent |
put(OpenSimObject obj,
ModelComponent comp)
Adds the component to the map
|
void |
putAll(java.util.Map<? extends OpenSimObject,? extends ModelComponent> m) |
ModelComponent |
remove(java.lang.Object key) |
java.util.HashMap<ModelComponent,OpenSimObject> |
reverseMap() |
int |
size() |
java.util.Collection<ModelComponent> |
values() |
public <O extends OpenSimObject> O findObjectByName(java.lang.Class<O> baseClass, java.lang.String name)
baseClass
- base class for type conversionname
- object namepublic <O extends OpenSimObject> O findObjectByPathOrName(java.lang.Class<O> baseClass, OpenSimObject ref, java.lang.String pathOrName)
baseClass
- base class for type conversionref
- reference object for resolving relative pathspathOrName
- object path or namepublic OpenSimObject findObjectByName(java.lang.String name)
name
- object namepublic OpenSimObject findObjectByPath(OpenSimObject obj, java.lang.String path)
obj
- object from which path is requested (for relative path resolution)path
- absolute or relative pathpublic ModelComponent put(OpenSimObject obj, ModelComponent comp)
put
in interface java.util.Map<OpenSimObject,ModelComponent>
obj
- OpenSimObjectcomp
- corresponding ModelComponentpublic ModelComponent get(OpenSimObject obj)
obj
- objectpublic JointSet getJointSet()
public BodySet getBodySet()
public int size()
size
in interface java.util.Map<OpenSimObject,ModelComponent>
public boolean isEmpty()
isEmpty
in interface java.util.Map<OpenSimObject,ModelComponent>
public boolean containsKey(java.lang.Object key)
containsKey
in interface java.util.Map<OpenSimObject,ModelComponent>
public boolean containsValue(java.lang.Object value)
containsValue
in interface java.util.Map<OpenSimObject,ModelComponent>
public ModelComponent get(java.lang.Object key)
get
in interface java.util.Map<OpenSimObject,ModelComponent>
public ModelComponent remove(java.lang.Object key)
remove
in interface java.util.Map<OpenSimObject,ModelComponent>
public void putAll(java.util.Map<? extends OpenSimObject,? extends ModelComponent> m)
putAll
in interface java.util.Map<OpenSimObject,ModelComponent>
public void clear()
clear
in interface java.util.Map<OpenSimObject,ModelComponent>
public java.util.Set<OpenSimObject> keySet()
keySet
in interface java.util.Map<OpenSimObject,ModelComponent>
public java.util.Collection<ModelComponent> values()
values
in interface java.util.Map<OpenSimObject,ModelComponent>
public java.util.Set<java.util.Map.Entry<OpenSimObject,ModelComponent>> entrySet()
entrySet
in interface java.util.Map<OpenSimObject,ModelComponent>
public java.util.HashMap<ModelComponent,OpenSimObject> reverseMap()