public class IlvSingleValueNamedProperty extends IlvNamedProperty implements Serializable
IlvSingleValueNamedProperty
is a named property
for general purpose that allows to store a simple single value.
It can be used when it is necessary to save one value to an .ivl file,
and this value is one of the following types:
boolean
, int
, short
,
long
, float
, double
,
Boolean
, Integer
, Short
,
Long
, Float
, Double
,
String
, Color
, Font
,
IlvPoint
, IlvRect
, IlvTransformer
,
IlvPersistentObject
,
IlvGraphic
,
boolean[]
, int[]
, short[]
,
long[]
, float[]
, double[]
,
String[]
, Color[]
, Font[]
,
IlvPoint[]
, IlvRect[]
,
IlvTransformer[]
,IlvPersistentObject[]
,
IlvIlvGraphic[]
.
Note that self cycles must be avoided, i.e. you cannot store a
single value named property containing a graphic in that graphic itself.Constructor and Description |
---|
IlvSingleValueNamedProperty(IlvInputStream stream)
Creates a new
IlvSingleValueNamedProperty from
an IlvInputStream . |
IlvSingleValueNamedProperty(IlvSingleValueNamedProperty source)
Creates a new
IlvSingleValueNamedProperty by copying an
existing one. |
IlvSingleValueNamedProperty(String name,
boolean value)
Creates a new
IlvSingleValueNamedProperty . |
IlvSingleValueNamedProperty(String name,
double value)
Creates a new
IlvSingleValueNamedProperty . |
IlvSingleValueNamedProperty(String name,
float value)
Creates a new
IlvSingleValueNamedProperty . |
IlvSingleValueNamedProperty(String name,
int value)
Creates a new
IlvSingleValueNamedProperty . |
IlvSingleValueNamedProperty(String name,
long value)
Creates a new
IlvSingleValueNamedProperty . |
IlvSingleValueNamedProperty(String name,
Object value)
Creates a new
IlvSingleValueNamedProperty . |
IlvSingleValueNamedProperty(String name,
short value)
Creates a new
IlvSingleValueNamedProperty . |
Modifier and Type | Method and Description |
---|---|
boolean |
booleanValue()
Returns the value stored in the named property, if the value is a
boolean . |
IlvNamedProperty |
copy()
Copies the named property.
|
double |
doubleValue()
Returns the value stored in the named property, if the value is a
double . |
float |
floatValue()
Returns the value stored in the named property, if the value is a
float . |
Object |
getValue()
Returns the value stored in the named property.
|
int |
intValue()
Returns the value stored in the named property, if the value is a
int . |
boolean |
isPersistent()
Returns
true if the property must be saved to an .ivl file. |
long |
longValue()
Returns the value stored in the named property, if the value is a
long . |
void |
setValue(boolean value)
Sets the value of the named property, if the value is
boolean . |
void |
setValue(double value)
Sets the value of the named property, if the value is
double . |
void |
setValue(float value)
Sets the value of the named property, if the value is
float . |
void |
setValue(int value)
Sets the value of the named property, if the value is
int . |
void |
setValue(long value)
Sets the value of the named property, if the value is
long . |
void |
setValue(Object value)
Sets the value of the named property.
|
void |
setValue(short value)
Sets the value of the named property, if the value is
short . |
short |
shortValue()
Returns the value stored in the named property, if the value is a
short . |
void |
write(IlvOutputStream stream)
Writes the property to the output stream.
|
getName
public IlvSingleValueNamedProperty(String name, Object value)
IlvSingleValueNamedProperty
.
The value can be saved to an .ivl files if and only if
it is one of those types:
Boolean
, Integer
, Short
,
Long
, Float
, Double
,
String
, Color
, Font
,
IlvPoint
, IlvRect
, IlvTransformer
,
boolean[]
, int[]
, short[]
,
long[]
, float[]
, double[]
,
String[]
, Color[]
, Font[]
,
IlvPoint[]
, IlvRect[]
,
IlvTransformer[]
,IlvPersistentObject
.name
- The name of the property.value
- The value to be stored.public IlvSingleValueNamedProperty(String name, boolean value)
IlvSingleValueNamedProperty
.name
- The name of the property.value
- The value to be stored if it is a boolean
.public IlvSingleValueNamedProperty(String name, short value)
IlvSingleValueNamedProperty
.name
- The name of the property.value
- The value to be stored if it is a short
.public IlvSingleValueNamedProperty(String name, int value)
IlvSingleValueNamedProperty
.name
- The name of the property.value
- The value to be stored if it is a int
.public IlvSingleValueNamedProperty(String name, long value)
IlvSingleValueNamedProperty
.name
- The name of the property.value
- The value to be stored if it is a long
.public IlvSingleValueNamedProperty(String name, float value)
IlvSingleValueNamedProperty
.name
- The name of the property.value
- The value to be stored if it is a float
.public IlvSingleValueNamedProperty(String name, double value)
IlvSingleValueNamedProperty
.name
- The name of the property.value
- The value to be stored if it is a double
.public IlvSingleValueNamedProperty(IlvSingleValueNamedProperty source)
IlvSingleValueNamedProperty
by copying an
existing one.source
- The origin of the copy.public IlvSingleValueNamedProperty(IlvInputStream stream) throws IOException, IlvReadFileException
IlvSingleValueNamedProperty
from
an IlvInputStream
.stream
- The input stream from which the property must be read.IlvReadFileException
- if an error occurs while reading.IOException
public void setValue(Object value)
Boolean
, Integer
, Short
,
Long
, Float
, Double
,
String
, Color
, Font
,
IlvPoint
, IlvRect
, IlvTransformer
,
IlvPersistentObject
, IlvGraphic
,
boolean[]
, int[]
, short[]
,
long[]
, float[]
, double[]
,
String[]
, Color[]
, Font[]
,
IlvPoint[]
, IlvRect[]
,
IlvTransformer[]
,IlvPersistentObject[]
,
IlvGraphic[]
.public void setValue(boolean value)
boolean
.public void setValue(short value)
short
.public void setValue(int value)
int
.public void setValue(long value)
long
.public void setValue(float value)
float
.public void setValue(double value)
double
.public Object getValue()
public boolean booleanValue()
boolean
.
Throws a NullPointerException
if the value was never set.
Throws a ClassCastException
if the value is not a
boolean
.public short shortValue()
short
.
Throws a NullPointerException
if the value was never set.
Throws a ClassCastException
if the value is not a
short
.public int intValue()
int
.
Throws a NullPointerException
if the value was never set.
Throws a ClassCastException
if the value is not a
int
.public long longValue()
long
.
Throws a NullPointerException
if the value was never set.
Throws a ClassCastException
if the value is not a
long
.public float floatValue()
float
.
Throws a NullPointerException
if the value was never set.
Throws a ClassCastException
if the value is not a
float
.public double doubleValue()
double
.
Throws a NullPointerException
if the value was never set.
Throws a ClassCastException
if the value is not a
double
.public IlvNamedProperty copy()
copy
in class IlvNamedProperty
public boolean isPersistent()
true
if the property must be saved to an .ivl file.isPersistent
in class IlvNamedProperty
public void write(IlvOutputStream stream) throws IOException
write
in interface IlvPersistentObject
write
in class IlvNamedProperty
stream
- The output stream.IOException
- standard IO error.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.