|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.properties.spi.core.value.CollectionPropertyValueRange<T>
T
- the type of the property values within the given range. Please note that the type is required to be serializable. Otherwise instances of this class are also not serializable.
public final class CollectionPropertyValueRange<T>
Defines a set of valid enumerable elements for values of a property.
Constructor Summary | |
---|---|
CollectionPropertyValueRange(Collection<T> values) Constructor accepting a collection of values. |
|
CollectionPropertyValueRange(T[] values) Constructor accepting an array of values. |
Method Summary | |
---|---|
boolean |
equals(Object object) Returns true if the given object is semantically equal to the given object, false otherwise. |
T |
fromString(String valueAsString) Constructs a value of the real type T from the given string representation of a value of the range. |
List<T> |
getValues() Returns the list of values provided by the property range. |
int |
hashCode() Returns the hash code of the object. |
boolean |
isCommented() Checks whether or not the values have comments. |
String |
toString() Returns the list of possible values or any form to show the the range of values to select from using the default locale. |
String |
toString(Locale locale) Returns the list of possible values or any form to show the the range of values to select from. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CollectionPropertyValueRange(T[] values) throws de.smartics.util.lang.NullArgumentException
values
- the allowed values for this value range.
de.smartics.util.lang.NullArgumentException
- if
values
is
null
.
public CollectionPropertyValueRange(Collection<T> values) throws de.smartics.util.lang.NullArgumentException
values
- the allowed values for this value range.
de.smartics.util.lang.NullArgumentException
- if
values
is
null
.
Method Detail |
---|
public List<T> getValues()
PropertyValueRange
PropertyValueRange.toString()
returns information about the values that should be rendered instead.
Example:
For instance, if the range is restricted to prime numbers, this method returns the empty list and the <A HREF="../../../../../../de/smartics/properties/api/core/domain/PropertyValueRange.html#toString()"><CODE>PropertyValueRange.toString()</CODE></A> method returns the descriptive text "Only prime numbers are allowed as values for this property.".
getValues
in interface
PropertyValueRange<T>
public T fromString(String valueAsString) throws IllegalArgumentException
PropertyValueRange
T
from the given string representation of a value of the range.
fromString
in interface
PropertyValueRange<T>
valueAsString
- the string representation of the value.
T
.
IllegalArgumentException
- if the given string argument cannot be parsed and is therefore illegal to construct an instance of type
<T>
.
public boolean isCommented()
PropertyValueRange
isCommented
in interface
PropertyValueRange<T>
true
if the values have comments,
false
if the values have no comments.
public int hashCode()
hashCode
in class
Object
public boolean equals(Object object)
true
if the given object is semantically equal to the given object,
false
otherwise.
equals
in class
Object
object
- the instance to compare to.
true
if the given object is semantically equal to the given object,
false
otherwise.
public String toString(Locale locale)
PropertyValueRange
toString
in interface
PropertyValueRange<T>
locale
- the locale to use for formatting.
public String toString()
PropertyValueRange
toString
in interface
PropertyValueRange<T>
toString
in class
Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |