edu.brook.ascape.util
Class SweepDimension

java.lang.Object
  |
  +--edu.brook.ascape.util.PropertyAccessor
        |
        +--edu.brook.ascape.util.SweepDimension

public class SweepDimension
extends PropertyAccessor
implements Sweepable

A class faciliating iteration across a paramater dimension. This class has the neat feature that it will set the object to the next value itself on a call to next.

Since:
1.9 8/1/2000
Version:
1.9
See Also:
Serialized Form

Constructor Summary
SweepDimension(java.lang.Object object, java.lang.String accessorName, double _start, double _end, double _increment)
          Constructs a dimension composed of the object and an double accessor (property) for that object, providing start, final , and increment values.
SweepDimension(java.lang.Object object, java.lang.String accessorName, float _start, float _end, float _increment)
          Constructs a dimension composed of the object and an float accessor (property) for that object, providing start, final , and increment values.
SweepDimension(java.lang.Object object, java.lang.String accessorName, int _start, int _end)
          Constructs a dimension composed of the object and an integer accessor (property) for that object, providing start, final , and increment values.
SweepDimension(java.lang.Object object, java.lang.String accessorName, int _start, int _end, int _increment)
          Constructs a dimension composed of the object and an integer accessor (property) for that object, providing start, final , and increment values.
SweepDimension(java.lang.Object object, java.lang.String accessorName, long _start, long _end, long _increment)
          Constructs a dimension composed of the object and an long accessor (property) for that object, providing start, final , and increment values.
 
Method Summary
 java.lang.String getIncrementAsText()
          Returns the increment value as a text string.
 java.lang.String getMaxAsText()
          Returns the maximum value as a text string.
 java.lang.String getMinAsText()
          Returns the minimum value as a text string.
 boolean hasNext()
          Returns true if the dimension hasn't yet reached its final (terminal) value.
 java.lang.Object next()
          Iterates to the next dimension value, setting the property of the object with the new value.
 void reset()
          Resets the dimension to its original value.
 void setIncrementAsText(java.lang.String string)
          Sets the increment value as a text string.
 void setMaxAsText(java.lang.String string)
          Sets the maximum value as a text string.
 void setMinAsText(java.lang.String string)
          Sets the minimum value as a text string.
static boolean test(edu.brook.ascape.util.SweepDimension.TestObject blah)
           
 
Methods inherited from class edu.brook.ascape.util.PropertyAccessor
addSpacesToVariableName, capitalizeFirstCharacter, determineAccessors, determineAccessors, getAsText, getDescriptor, getLongName, getName, getValue, isWriteable, removeUnderscores, setAsText, setDescriptor, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SweepDimension

public SweepDimension(java.lang.Object object,
                      java.lang.String accessorName,
                      int _start,
                      int _end,
                      int _increment)
Constructs a dimension composed of the object and an integer accessor (property) for that object, providing start, final , and increment values.
Parameters:
object - the object to have its state changed.
accessorName - the name of the accessor, following the standard Java propert pattern.
start - the start value for the dimension (int)
start - the final (termination) value for the dimension (int)
start - the iteration amount for the dimension (int)

SweepDimension

public SweepDimension(java.lang.Object object,
                      java.lang.String accessorName,
                      int _start,
                      int _end)
Constructs a dimension composed of the object and an integer accessor (property) for that object, providing start, final , and increment values. Assumed to iterate by one (as in i++) each time.
Parameters:
object - the object to have its state changed.
accessorName - the name of the accessor, following the standard Java propert pattern.
start - the start value for the dimension (int)
start - the final (termination) value for the dimension (int)

SweepDimension

public SweepDimension(java.lang.Object object,
                      java.lang.String accessorName,
                      double _start,
                      double _end,
                      double _increment)
Constructs a dimension composed of the object and an double accessor (property) for that object, providing start, final , and increment values.
Parameters:
object - the object to have its state changed.
accessorName - the name of the accessor, following the standard Java propert pattern.
start - the start value for the dimension (int)
start - the final (termination) value for the dimension (int)
start - the iteration amount for the dimension (int)

SweepDimension

public SweepDimension(java.lang.Object object,
                      java.lang.String accessorName,
                      float _start,
                      float _end,
                      float _increment)
Constructs a dimension composed of the object and an float accessor (property) for that object, providing start, final , and increment values.
Parameters:
object - the object to have its state changed.
accessorName - the name of the accessor, following the standard Java propert pattern.
start - the start value for the dimension (int)
start - the final (termination) value for the dimension (int)
start - the iteration amount for the dimension (int)

SweepDimension

public SweepDimension(java.lang.Object object,
                      java.lang.String accessorName,
                      long _start,
                      long _end,
                      long _increment)
Constructs a dimension composed of the object and an long accessor (property) for that object, providing start, final , and increment values.
Parameters:
object - the object to have its state changed.
accessorName - the name of the accessor, following the standard Java propert pattern.
start - the start value for the dimension (int)
start - the final (termination) value for the dimension (int)
start - the iteration amount for the dimension (int)
Method Detail

getMinAsText

public java.lang.String getMinAsText()
Returns the minimum value as a text string.

setMinAsText

public void setMinAsText(java.lang.String string)
Sets the minimum value as a text string.

getMaxAsText

public java.lang.String getMaxAsText()
Returns the maximum value as a text string.

setMaxAsText

public void setMaxAsText(java.lang.String string)
Sets the maximum value as a text string.

getIncrementAsText

public java.lang.String getIncrementAsText()
Returns the increment value as a text string.

setIncrementAsText

public void setIncrementAsText(java.lang.String string)
Sets the increment value as a text string.

reset

public void reset()
Resets the dimension to its original value.
Specified by:
reset in interface Sweepable

hasNext

public boolean hasNext()
Returns true if the dimension hasn't yet reached its final (terminal) value.
Specified by:
hasNext in interface Sweepable

next

public java.lang.Object next()
Iterates to the next dimension value, setting the property of the object with the new value.
Specified by:
next in interface Sweepable

test

public static boolean test(edu.brook.ascape.util.SweepDimension.TestObject blah)

(c) 1998-2000 The Brookings Insitution
Webpage