Class MultiDoublePropertyState
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.memory.AbstractPropertyState
-
- org.apache.jackrabbit.oak.plugins.memory.EmptyPropertyState
-
- org.apache.jackrabbit.oak.plugins.memory.MultiDoublePropertyState
-
- All Implemented Interfaces:
org.apache.jackrabbit.oak.api.PropertyState
public class MultiDoublePropertyState extends EmptyPropertyState
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<T>
values
-
Constructor Summary
Constructors Constructor Description MultiDoublePropertyState(java.lang.String name, java.lang.Iterable<java.lang.Double> values)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
count()
static org.apache.jackrabbit.oak.api.PropertyState
doubleProperty(java.lang.String name, java.lang.Iterable<java.lang.Double> values)
Create a multi valuedPropertyState
from a list of doubles.Conversions.Converter
getConverter(java.lang.Double value)
Create a converter for converting a value to other types.org.apache.jackrabbit.oak.api.Type<?>
getType()
<S> S
getValue(org.apache.jackrabbit.oak.api.Type<S> type)
<S> S
getValue(org.apache.jackrabbit.oak.api.Type<S> type, int index)
long
size(int index)
-
Methods inherited from class org.apache.jackrabbit.oak.plugins.memory.EmptyPropertyState
emptyProperty, getName, isArray, size
-
-
-
-
Method Detail
-
doubleProperty
public static org.apache.jackrabbit.oak.api.PropertyState doubleProperty(java.lang.String name, java.lang.Iterable<java.lang.Double> values)
Create a multi valuedPropertyState
from a list of doubles.- Parameters:
name
- The name of the property statevalues
- The values of the property state- Returns:
- The new property state of type
Type.DOUBLES
-
getConverter
public Conversions.Converter getConverter(java.lang.Double value)
Create a converter for converting a value to other types.- Parameters:
value
- The value to convert- Returns:
- A converter for the value of this property
-
getType
public org.apache.jackrabbit.oak.api.Type<?> getType()
-
getValue
@NotNull public <S> S getValue(org.apache.jackrabbit.oak.api.Type<S> type)
- Specified by:
getValue
in interfaceorg.apache.jackrabbit.oak.api.PropertyState
- Overrides:
getValue
in classEmptyPropertyState
- Returns:
- An empty list if
type.isArray()
istrue
. - Throws:
java.lang.IllegalStateException
- iftype.isArray()
isfalse
.java.lang.IllegalArgumentException
- iftype
is not one of the values defined inType
-
getValue
@NotNull public <S> S getValue(org.apache.jackrabbit.oak.api.Type<S> type, int index)
- Specified by:
getValue
in interfaceorg.apache.jackrabbit.oak.api.PropertyState
- Overrides:
getValue
in classEmptyPropertyState
- Throws:
java.lang.IllegalArgumentException
- iftype
is not one of the values defined inType
or iftype.isArray()
istrue
java.lang.IndexOutOfBoundsException
- ifindex >= count()
.
-
count
public final int count()
- Specified by:
count
in interfaceorg.apache.jackrabbit.oak.api.PropertyState
- Overrides:
count
in classEmptyPropertyState
- Returns:
0
-
size
public long size(int index)
- Specified by:
size
in interfaceorg.apache.jackrabbit.oak.api.PropertyState
- Overrides:
size
in classEmptyPropertyState
-
-