public class IlvMinMaxBehavior extends IlvSingleBehavior
IlvMinMaxBehavior
is used to test whether a value is
contained between a minimum and a maximum value. This class is similar to the
class IlvConditionBehavior
, except that it tests two conditions
instead of one: value < min
and value <= max
.
Depending on the results of these tests, a specific property will be set to
one of three possible values. This class also lets you specify a special
condition, which, if satisfied, will bypass the result of the test.
This class is defined only for compatibility with Views C++ prototypes. It
should not be used when creating new prototypes. Instead, you should use two
IlvConditionBehavior
objects to test the value against the
minimum and maximum bounds.IlvConditionBehavior
,
Serialized FormConstructor and Description |
---|
IlvMinMaxBehavior(IlvInputStream in)
Reads the behavior from an
IlvInputStream stream. |
IlvMinMaxBehavior(IlvMinMaxBehavior source)
Creates a new behavior object by copying an existing one.
|
IlvMinMaxBehavior(String name,
String min,
String max,
String except,
String target,
String ifLess,
String ifBetween,
String ifMore)
Creates a new min/max behavior object.
|
Modifier and Type | Method and Description |
---|---|
IlvBehavior |
copy()
Returns a copy of the behavior.
|
String |
getExcept()
Gets the
except parameter for this behavior object. |
String |
getIfBetween()
Gets the
ifBetween parameter for this behavior object. |
String |
getIfLess()
Gets the
ifLess parameter for this behavior object. |
String |
getIfMore()
Gets the
ifMore parameter for this behavior object. |
String |
getMax()
Gets the
max parameter for this behavior object. |
String |
getMin()
Gets the
min parameter for this behavior object. |
String |
getTarget()
Gets the
target parameter for this behavior object. |
boolean |
isReadable()
Returns
false |
protected void |
set(IlvGroup group,
String name,
Object value)
If the value specified by the
except parameter passed to the
constructor is true , this method does nothing. |
void |
setExcept(String except)
Sets the
except parameter for this behavior object. |
void |
setIfBetween(String ifBetween)
Sets the
ifBetween parameter for this behavior object. |
void |
setIfLess(String ifLess)
Sets the
ifLess parameter for this behavior object. |
void |
setIfMore(String ifMore)
Sets the
ifMore parameter for this behavior object. |
void |
setMax(String max)
Sets the
max parameter for this behavior object. |
void |
setMin(String min)
Sets the
min parameter for this behavior object. |
void |
setTarget(String target)
Sets the
target parameter for this behavior object. |
String |
toString()
Returns a short text describing this behavior object.
|
void |
write(IlvOutputStream out)
Writes the behavior to an
IlvOutputStream . |
get, get, getName, getValueNames, set, setName
attach, detach, getParameter, isOutput, isWritable
public IlvMinMaxBehavior(String name, String min, String max, String except, String target, String ifLess, String ifBetween, String ifMore)
name
- the name of this behavior object.min
- the minimum bound. This value can be either a direct value, the
name of another property, or an expression.max
- the maximum bound. This value can be either a direct value, the
name of another property, or an expression.except
- a value specifying a special condition that will bypass the result
of the tests if it is satisfied. This value can be either a direct
value, the name of another property, or an expression.target
- the name of the property which will be set to one of the following
values depending on the result of test: ifLess
,
inBetween
or ifMore
.ifLess
- the value to which to
will be set if the new value is
less than min
. This value can be either a direct
value, the name of another property, or an expression.ifBetween
- the value to which to
will be set if the new value is
greater than min
and less than max
. This
value can be either a direct value, the name of another property,
or an expression.ifMore
- the value to which to
will be set if the new value is
greater than max
. This value can be either a direct
value, the name of another property, or an expression.public IlvMinMaxBehavior(IlvMinMaxBehavior source)
source
- the behavior object to be copied.public IlvMinMaxBehavior(IlvInputStream in) throws IlvReadFileException
IlvInputStream
stream. This
constructor must be called by the input constructors of subclasses.in
- The input stream.IlvReadFileException
- if the stream format is not correct.public void write(IlvOutputStream out) throws IOException
IlvOutputStream
.write
in interface IlvPersistentObject
write
in class IlvSingleBehavior
out
- The output stream.IOException
- thrown when an exception occurs during
the write operation for this object.public IlvBehavior copy()
copy
in class IlvBehavior
public String toString()
toString
in class IlvBehavior
public boolean isReadable()
false
isReadable
in class IlvBehavior
protected void set(IlvGroup group, String name, Object value) throws IlvValueException
except
parameter passed to the
constructor is true
, this method does nothing. Otherwise, it
compares the new value
with the min
and
max
parameters passed to the constructor. Depending on whether
that value is less than min
, between min
and
max
, or greater than max
, the value specified by
the to
parameter of the constructor is set to the value
specified by the parameters ifLess
, ifBetween
, or
ifMore
respectively.
The value of ifLess
, isBetween
or
isMore
can be the empty string "\"\""
. In this
case, the to
value must not be set.
set
in class IlvSingleBehavior
group
- the group to which this behavior object is attached.name
- the name of this behavior object.value
- the new value for which the condition is tested.IlvValueException
- if an error occurred while setting a property.IlvSingleBehavior.set(ilog.views.prototypes.IlvGroup,
java.lang.String[], java.lang.Object[], boolean[])
public void setMin(String min)
min
parameter for this behavior object.public String getMin()
min
parameter for this behavior object.public void setMax(String max)
max
parameter for this behavior object.public String getMax()
max
parameter for this behavior object.public void setExcept(String except)
except
parameter for this behavior object.public String getExcept()
except
parameter for this behavior object.public void setTarget(String target)
target
parameter for this behavior object.public String getTarget()
target
parameter for this behavior object.public void setIfLess(String ifLess)
ifLess
parameter for this behavior object.public String getIfLess()
ifLess
parameter for this behavior object.public void setIfBetween(String ifBetween)
ifBetween
parameter for this behavior object.public String getIfBetween()
ifBetween
parameter for this behavior object.public void setIfMore(String ifMore)
ifMore
parameter for this behavior object.public String getIfMore()
ifMore
parameter for this behavior object.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.