public class DefaultComponentStore extends java.lang.Object implements ComponentStore
ComponentStore that allows for concurrent
modification| Constructor and Description |
|---|
DefaultComponentStore() |
| Modifier and Type | Method and Description |
|---|---|
void |
addComponent(Component component)
|
<T> T |
getComponent(java.lang.Class<T> clazz) |
<T> T |
getComponent(int componentTypeId) |
<T extends Component> |
getComponent(java.lang.String name,
java.lang.Class<T> clazz) |
<T extends Component> |
getComponent(java.lang.String name,
int componentTypeId) |
<T> java.util.SortedSet<T> |
getComponents(java.lang.Class<T> clazz)
Returns all
Components that implement the specified the class or
interface |
<T> java.util.SortedSet<T> |
getComponents(int componentTypeId)
Returns all
Components that implement the specified the class or
interface |
<T extends Component> |
removeAllComponentsOfType(java.lang.Class<T> clazz)
Removes all
Components that implement a specific type |
<T extends Component> |
removeAllComponentsOfType(int componentTypeId)
Removes all
Components that implement a specific type |
void |
removeComponent(Component component)
|
public <T> T getComponent(int componentTypeId)
getComponent in interface ComponentStorepublic <T> T getComponent(java.lang.Class<T> clazz)
getComponent in interface ComponentStorepublic <T extends Component> T getComponent(java.lang.String name, int componentTypeId)
getComponent in interface ComponentStorepublic <T extends Component> T getComponent(java.lang.String name, java.lang.Class<T> clazz)
getComponent in interface ComponentStorepublic void addComponent(Component component)
addComponent in interface ComponentStorecomponent - An instance of Componentpublic <T> java.util.SortedSet<T> getComponents(int componentTypeId)
ComponentStoreComponents that implement the specified the class or
interfacegetComponents in interface ComponentStorecomponentTypeId - The unique identifier of the component typeList if no such Components are attached
to this Entitypublic <T> java.util.SortedSet<T> getComponents(java.lang.Class<T> clazz)
Components that implement the specified the class or
interfacegetComponents in interface ComponentStoreclazz - The Class to search forList if no such Components are attached
to this Entitypublic void removeComponent(Component component)
removeComponent in interface ComponentStorecomponent - The Component to removepublic <T extends Component> java.util.SortedSet<T> removeAllComponentsOfType(java.lang.Class<T> clazz)
Components that implement a specific typeremoveAllComponentsOfType in interface ComponentStoreclazz - The Class to search forpublic <T extends Component> java.util.SortedSet<T> removeAllComponentsOfType(int componentTypeId)
ComponentStoreComponents that implement a specific typeremoveAllComponentsOfType in interface ComponentStorecomponentTypeId - The unique identifier of the component type