Module org.praxislive.code
Package org.praxislive.code
Class CodeRootContainer<D extends CodeRootContainerDelegate>
- java.lang.Object
-
- org.praxislive.code.CodeComponent<D>
-
- org.praxislive.code.CodeRoot<D>
-
- org.praxislive.code.CodeRootContainer<D>
-
- Type Parameters:
D
- wrapped delegate type
- All Implemented Interfaces:
Component
,Container
,Lookup.Provider
,Root
public class CodeRootContainer<D extends CodeRootContainerDelegate> extends CodeRoot<D> implements Container
ARoot
container instance that is rewritable at runtime. The CodeRootContainer itself remains constant, but passes most responsibility to aCodeRootContainer.Context
wrapping aCodeRootContainerDelegate
(user code). This component handles switching from one context to the next. A CodeRoot cannot be created directly - seeCodeFactory
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CodeRootContainer.Connector<D extends CodeRootContainerDelegate>
CodeConnector subclass for CodeRootContainers.static class
CodeRootContainer.Context<D extends CodeRootContainerDelegate>
CodeContext subclass for CodeRootContainers.-
Nested classes/interfaces inherited from interface org.praxislive.core.Root
Root.Controller
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stream<String>
children()
Get a Stream of the child IDs that this container makes publicly visible.ComponentAddress
getAddress(Component child)
Get the address for the provided child component, or null if the component is not a child of this container.Component
getChild(String id)
Get child component with specific ID.Lookup
getLookup()
Get the Lookup from this Provider.void
hierarchyChanged()
Notify the component that a change has happened in its component hierarchy.-
Methods inherited from class org.praxislive.code.CodeRoot
initialize, parentNotify
-
Methods inherited from class org.praxislive.code.CodeComponent
getControl, getInfo, getParent, getPort
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.praxislive.core.Component
getControl, getInfo, getParent, getPort, parentNotify
-
-
-
-
Method Detail
-
children
public Stream<String> children()
Description copied from interface:Container
Get a Stream of the child IDs that this container makes publicly visible. Containers may have hidden children that can be returned fromContainer.getChild(java.lang.String)
but are not listed here. All IDs returned should correspond to valid components, and (if provided) match the implementation ofContainerProtocol
.A Stream is returned allowing flexibility in implementation.
-
getAddress
public ComponentAddress getAddress(Component child)
Description copied from interface:Container
Get the address for the provided child component, or null if the component is not a child of this container.- Specified by:
getAddress
in interfaceContainer
- Parameters:
child
- component- Returns:
- address, or null of component is not a child of this container.
-
getChild
public Component getChild(String id)
Description copied from interface:Container
Get child component with specific ID.
-
getLookup
public Lookup getLookup()
Description copied from interface:Lookup.Provider
Get the Lookup from this Provider.- Specified by:
getLookup
in interfaceLookup.Provider
- Overrides:
getLookup
in classCodeRoot<D extends CodeRootContainerDelegate>
- Returns:
- lookup
-
hierarchyChanged
public void hierarchyChanged()
Description copied from interface:Component
Notify the component that a change has happened in its component hierarchy. For example its direct parent or an ancestor has changed. This method will be called after parentNotify() if the result of an immediate parent change.- Specified by:
hierarchyChanged
in interfaceComponent
- Overrides:
hierarchyChanged
in classCodeRoot<D extends CodeRootContainerDelegate>
-
-