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:
PropertyState
public class MultiDoublePropertyState extends EmptyPropertyState
-
-
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 intcount()The number of values of this property.static PropertyStatedoubleProperty(java.lang.String name, java.lang.Iterable<java.lang.Double> values)Create a multi valuedPropertyStatefrom a list of doubles.Conversions.ConvertergetConverter(java.lang.Double value)Create a converter for converting a value to other types.Type<?>getType()Determine the type of this property<S> SgetValue(Type<S> type)Value of this property.<S> SgetValue(Type<S> type, int index)Value at the givenindex.longsize(int index)The size of the value at the givenindex.-
Methods inherited from class org.apache.jackrabbit.oak.plugins.memory.EmptyPropertyState
emptyProperty, getName, isArray, size
-
-
-
-
Method Detail
-
doubleProperty
public static PropertyState doubleProperty(java.lang.String name, java.lang.Iterable<java.lang.Double> values)
Create a multi valuedPropertyStatefrom 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 Type<?> getType()
Description copied from interface:PropertyStateDetermine the type of this property- Returns:
- the type of this property
-
getValue
@NotNull public <S> S getValue(Type<S> type)
Description copied from interface:PropertyStateValue of this property. The type of the return value is determined by the targettypeargument. Iftype.isArray()is true, this method returns anIterableof thebase typeoftypecontaining all values of this property. If the target type is not the same as the type of this property an attempt is made to convert the value to the target type. If the conversion fails an exception is thrown. The actual conversions which take place are those defined in theorg.apache.jackrabbit.oak.plugins.value.Conversionsclass.- Specified by:
getValuein interfacePropertyState- Overrides:
getValuein classEmptyPropertyState- Parameters:
type- target type- Returns:
- An empty list if
type.isArray()istrue. - Throws:
java.lang.IllegalStateException- iftype.isArray()isfalse.java.lang.IllegalArgumentException- iftypeis not one of the values defined inType
-
getValue
@NotNull public <S> S getValue(Type<S> type, int index)
Description copied from interface:PropertyStateValue at the givenindex. The type of the return value is determined by the targettypeargument. If the target type is not the same as the type of this property an attempt is made to convert the value to the target type. If the conversion fails an exception is thrown. The actual conversions which take place are those defined in theorg.apache.jackrabbit.oak.plugins.value.Conversionsclass.- Specified by:
getValuein interfacePropertyState- Overrides:
getValuein classEmptyPropertyState- Parameters:
type- target type- Returns:
- the value of this property at the given
index - Throws:
java.lang.IllegalArgumentException- iftypeis not one of the values defined inTypeor iftype.isArray()istruejava.lang.IndexOutOfBoundsException- ifindex >= count().
-
count
public final int count()
Description copied from interface:PropertyStateThe number of values of this property.1for atoms.- Specified by:
countin interfacePropertyState- Overrides:
countin classEmptyPropertyState- Returns:
0
-
size
public long size(int index)
Description copied from interface:PropertyStateThe size of the value at the givenindex.- Specified by:
sizein interfacePropertyState- Overrides:
sizein classEmptyPropertyState- Returns:
- size of the value at the given
index.
-
-