java.lang.Object
org.praxislive.core.Value
org.praxislive.core.types.PArray.ArrayBasedValue
- Direct Known Subclasses:
Connection
- Enclosing class:
PArray
An abstract superclass for values that are backed solely by a PArray.
Subclassing this type can help with efficient serialization of the
underlying representation. The concrete value type must be able to
construct an equivalent value entirely from the PArray returned from
dataArray().
The toString, equals, equivalent and hashCode methods are all implemented based solely on the array data.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.praxislive.core.Value
Value.Type<T extends Value> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedArrayBasedValue(PArray data) Construct a MapBasedValue using the provided data map. -
Method Summary
Modifier and TypeMethodDescriptionfinal PArrayAccess the backing PArray data.final booleanValues must override the default equals method.final booleanequivalent(Value value) Indicates whether some other Value is equivalent to this one.final inthashCode()Values must override the default hashcode method.final StringtoString()Values must override the default method to return a string representation that is immutable.
-
Constructor Details
-
ArrayBasedValue
Construct a MapBasedValue using the provided data map.- Parameters:
data- data map
-
-
Method Details
-
dataArray
Access the backing PArray data.- Returns:
- backing array
-
toString
Description copied from class:ValueValues must override the default method to return a string representation that is immutable. -
hashCode
public final 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()) -
equivalent
Description copied from class:ValueIndicates whether some other Value is equivalent to this one. UnlikeValue.equals(java.lang.Object)this method is not symmetric - a value of a different type might be equivalent to this without the other type considering the reverse to be true.The default implementation uses identity or String equality.
- Overrides:
equivalentin classValue- Parameters:
value- value to test for equivalence- Returns:
- true if value is equivalent to this
-