|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.dna.graph.property.basic.BasicProperty
org.jboss.dna.graph.property.basic.BasicEmptyProperty
@Immutable public class BasicEmptyProperty
An immutable version of a property that has no values. This is done for efficiency of the in-memory representation, since many properties will have just a single value, while others will have multiple values.
Constructor Summary | |
---|---|
BasicEmptyProperty(Name name)
Create a property with no values. |
Method Summary | |
---|---|
Object |
getFirstValue()
Obtain the property's first value in its natural form. |
boolean |
isEmpty()
Determine whether this property has no actual values. |
boolean |
isMultiple()
Determine whether the property currently has multiple values. |
boolean |
isSingle()
Determine whether the property currently has a single value. |
Iterator<Object> |
iterator()
|
int |
size()
Get the number of actual values in this property. |
Methods inherited from class org.jboss.dna.graph.property.basic.BasicProperty |
---|
compareTo, equals, getName, getString, getString, getString, getString, getString, getValues, getValuesAsArray, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BasicEmptyProperty(Name name)
name
- the property nameMethod Detail |
---|
public boolean isEmpty()
true
regardless of whether the
property allows a single value
, or multiple values
.
This method is a convenience method that is equivalent to size() == 0
.
Property.isMultiple()
,
Property.isSingle()
public boolean isMultiple()
Property.isSingle()
,
Property.isEmpty()
public boolean isSingle()
Property.isMultiple()
,
Property.isEmpty()
public int size()
multiple values
, then this
method may return a value greater than 1. If the property only allows a single value
, then this method
will return either 0 or 1. This method may return 0 regardless of whether the property allows a single
value
, or multiple values
.
public Object getFirstValue()
isEmpty() ? null : iterator().next()
empty
Property.getFirstValue()
public Iterator<Object> iterator()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |