org.apache.myfaces.trinidad.model
Class DefaultBoundedRangeModel

java.lang.Object
  extended by org.apache.myfaces.trinidad.model.BoundedRangeModel
      extended by org.apache.myfaces.trinidad.model.DefaultBoundedRangeModel
All Implemented Interfaces:
Serializable

public class DefaultBoundedRangeModel
extends BoundedRangeModel
implements Serializable

Default BoundedRangeModel implementation. Defaults 'maximum' and 'value' to be -1. Validates that value <= maximum. This model implementation can conveniently be used by the 'progress' components.

Version:
$Name: $ ($Revision: adfrt/faces/adf-faces-api/src/main/java/oracle/adf/view/faces/model/DefaultBoundedRangeModel.java#0 $) $Date: 10-nov-2005.19:08:52 $
See Also:
Serialized Form

Constructor Summary
DefaultBoundedRangeModel()
          Construct a new DefaultBoundedRangeModel with defaults.
DefaultBoundedRangeModel(long value, long maximum)
          Constructs a new DefaultBoundedRangeModel with specified 'maximum' and 'value'.
 
Method Summary
 long getMaximum()
          Gets the maximum value for this model.
 long getValue()
          Gets the current value for this model.
 void setMaximum(long maximum)
          Sets the maximum value for this model.
 void setValue(long value)
          Sets the current value for this model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultBoundedRangeModel

public DefaultBoundedRangeModel()
Construct a new DefaultBoundedRangeModel with defaults.


DefaultBoundedRangeModel

public DefaultBoundedRangeModel(long value,
                                long maximum)
Constructs a new DefaultBoundedRangeModel with specified 'maximum' and 'value'. value should be in the range -1 <-> maximum.

Parameters:
value - - the value for this model.
maximum - - the maximum for this bounded range.
Throws:
IllegalArgumentException - if the value is not in the valid range.
Method Detail

getMaximum

public long getMaximum()
Description copied from class: BoundedRangeModel
Gets the maximum value for this model.

Specified by:
getMaximum in class BoundedRangeModel
Returns:
the maximum value. A return of -1 indicates that maximum is unknown.

getValue

public long getValue()
Description copied from class: BoundedRangeModel
Gets the current value for this model.

Specified by:
getValue in class BoundedRangeModel
Returns:
the current value. A return of -1 indicates that value is unknown.

setMaximum

public void setMaximum(long maximum)
Sets the maximum value for this model. Defaults to -1 which indicates that maximum is unknown.

Parameters:
maximum - the maximum value to be set

setValue

public void setValue(long value)
Sets the current value for this model. Ensure that the maximum is set before the value is being set. Value should be in the range -1 <-> maximum. Defaults to -1.

Parameters:
value - the current value to be set.
Throws:
IllegalArgumentException - if the value is not in the valid range.


Copyright © 2001-2012 The Apache Software Foundation. All Rights Reserved.