java.lang.Object
org.praxislive.core.Value
org.praxislive.core.ComponentAddress
Address of a Component. A component is a slash separated path of IDs,
starting with the ID of the Root that the Component is in, eg.
/rootID/parentID/componentID. ComponentAddresses are always absolute.-
Nested Class Summary
Nested classes/interfaces inherited from class org.praxislive.core.Value
Value.Type<T extends Value> -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionEquivalent to componentID(depth() - 1).componentID(int depth) Get ID at given depth in address.Get aControlAddressfor a control on this component.intdepth()Number of ID parts to this addressbooleanValues must override the default equals method.static Optional<ComponentAddress> inthashCode()Values must override the default hashcode method.static ArgumentInfoinfo()static booleanstatic ComponentAddressCreate an address from the supplied Stringstatic ComponentAddressof(ComponentAddress address, String path) Create a ComponentAddress by adding the supplied path to the end of the supplied ComponentAddress.parent()The parent address.static ComponentAddressCreate an address from the supplied StringGet aPortAddressfor a port on this component.Resolve the provided path or child ID against this address.rootID()Equivalent to componentID(0).toString()Values must override the default method to return a string representation that is immutable.Methods inherited from class org.praxislive.core.Value
equivalent, isEmpty, ofObject, type
-
Field Details
-
TYPE_NAME
Value type name.- See Also:
-
-
Method Details
-
depth
public int depth()Number of ID parts to this address- Returns:
- int Depth (always >=1)
-
componentID
Get ID at given depth in address.- Parameters:
depth-- Returns:
- String ID
-
componentID
Equivalent to componentID(depth() - 1).- Returns:
- String
-
rootID
Equivalent to componentID(0).- Returns:
- String
-
parent
The parent address. Returns null if this is a root address (depth == 1).- Returns:
- parent address, or null if root address.
-
resolve
Resolve the provided path or child ID against this address. The path should be relative and not start with a slash.- Parameters:
path- relative address to resolve- Returns:
- resolved address
-
control
Get aControlAddressfor a control on this component.- Parameters:
id- control id- Returns:
- control address
-
port
Get aPortAddressfor a port on this component.- Parameters:
id- port id- Returns:
- port address
-
toString
Description copied from class:ValueValues must override the default method to return a string representation that is immutable. -
hashCode
public int hashCode()Description copied from class:ValueValues must override the default hashcode method. -
equals
Description copied from class:ValueValues must override the default equals method. This method should only returntrueif the supplied Object is of the same type as the implementing Value. Values of an unknown type should be coerced before calling this method. This method does not have to guarantee thatthis.equals(that) == this.toString().equals(that.toString()) -
parse
Create an address from the supplied String- Parameters:
addressString-- Returns:
- ComponentAddress
- Throws:
ValueFormatException
-
of
Create an address from the supplied String- Parameters:
address-- Returns:
- ComponentAddress
- Throws:
IllegalArgumentException- on invalid string
-
of
Create a ComponentAddress by adding the supplied path to the end of the supplied ComponentAddress.- Parameters:
address-path-- Returns:
- ComponentAddress
- Throws:
IllegalArgumentException
-
from
-
isValidID
- Parameters:
id-- Returns:
-
info
-