net.rim.device.api.ui
Class Adjustment

java.lang.Object
  extended by net.rim.device.api.ui.Adjustment

public class Adjustment
extends Object

Abstract data structure used to establish a range of values and the step sizes contained within.

Since:
BlackBerry API 6.0.0

Constructor Summary
Adjustment(int value, int lower, int upper, int stepSize, int pageSize, int pageStepSize)
          Abstract data structure used to establish a range of values and the step sizes contained within.
 
Method Summary
 void addListener(AdjustmentListener listener)
          Register a listener to be notified of configuration and value change events.
 void configure(int value, int lower, int upper, int stepSize, int pageSize, int pageStepSize)
          Used to change everything at once in one synchronized method.
 int getCurrentPage()
          Get current page based on value vs page size.
 int getLower()
          Get lower bound.
 int getPageCount()
          Get the number of pages that will fit in this adjustment.
 int getPageSize()
          Get page size.
 int getPageStepSize()
          Get page step size.
 int getStepSize()
          Get step size.
 int getUpper()
          Get upper bound.
 int getValue()
          Get Value.
 void pageStepDown()
          Decrement Adjustment by page step amount.
 void pageStepUp()
          Increment Adjustment by page step amount.
 boolean removeListener(AdjustmentListener listener)
          Remove a listener so that it will no longer receive updates.
 void setLower(int lower)
          Set lower limit.
 void setPageSize(int size)
          Set page size.
 void setPageStep(int step)
          Set page step.
 void setStepSize(int step)
          Set step size.
 void setUpper(int upper)
          Set upper limit.
 void setValue(int value)
          Set current value.
 void stepDown()
          Decrement Adjustment by step amount.
 void stepUp()
          Increment Adjustment by step amount.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Constructor Detail

Adjustment

public Adjustment(int value,
                  int lower,
                  int upper,
                  int stepSize,
                  int pageSize,
                  int pageStepSize)
Abstract data structure used to establish a range of values and the step sizes contained within.

Parameters:
value - Represents the current value. Current value should, but is not required, to be within lower and upper boundaries.
lower - Represents the lowest possible value.
upper - Represents the highest possible value.
stepSize - Represents the increment used when adjusting the value. Should be at least 1.
pageSize - If greater than zero, the total range is divided into pages based on the specified size.
pageStepSize - Represents the minimum increment used when moving between pages.
Since:
BlackBerry API 6.0.0


Method Detail

addListener

public void addListener(AdjustmentListener listener)
Register a listener to be notified of configuration and value change events.

Parameters:
listener - Receives notifications.
Since:
BlackBerry API 6.0.0

removeListener

public boolean removeListener(AdjustmentListener listener)
Remove a listener so that it will no longer receive updates.

Parameters:
listener - Receives notifications
Returns:
true if the argument was a registered listener
Since:
BlackBerry API 6.0.0

configure

public void configure(int value,
                      int lower,
                      int upper,
                      int stepSize,
                      int pageSize,
                      int pageStepSize)
Used to change everything at once in one synchronized method.

Parameters:
value - Represents the current value. Current value must be within lower and upper boundaries.
lower - Represents the lowest possible value.
upper - Represents the highest possible value.
stepSize - Represents the increment used when adjusting the value. Should be at least 1.
pageSize - If greater than zero, the total range is divided into pages based on the specified size.
pageStepSize - Represents the minimum increment used when moving between pages.
Since:
BlackBerry API 6.0.0

getCurrentPage

public int getCurrentPage()
Get current page based on value vs page size. Will return -1 if the page size is 0.

Returns:
int (currentValue - lower)/pageSize
Since:
BlackBerry API 6.0.0

getLower

public int getLower()
Get lower bound.

Returns:
the lower bound
Since:
BlackBerry API 6.0.0

getPageCount

public int getPageCount()
Get the number of pages that will fit in this adjustment. Will return -1 if the page size is 0.

Returns:
int (upper - lower)/pageSize
Since:
BlackBerry API 6.0.0

getPageSize

public int getPageSize()
Get page size.

Returns:
the pageSize
Since:
BlackBerry API 6.0.0

getPageStepSize

public int getPageStepSize()
Get page step size.

Returns:
the pageStep size
Since:
BlackBerry API 6.0.0

getStepSize

public int getStepSize()
Get step size.

Returns:
the step size
Since:
BlackBerry API 6.0.0

getUpper

public int getUpper()
Get upper bound.

Returns:
the upper bound
Since:
BlackBerry API 6.0.0

getValue

public int getValue()
Get Value.

Returns:
the current value
Since:
BlackBerry API 6.0.0

pageStepDown

public void pageStepDown()
Decrement Adjustment by page step amount.

Since:
BlackBerry API 6.0.0

pageStepUp

public void pageStepUp()
Increment Adjustment by page step amount.

Since:
BlackBerry API 6.0.0

setLower

public void setLower(int lower)
Set lower limit.

Parameters:
lower - The minimum value.
Since:
BlackBerry API 6.0.0

setPageSize

public void setPageSize(int size)
Set page size. If greater than zero, the total range is divided into pages based on the specified size.

Parameters:
size - The pageSize to set.
Since:
BlackBerry API 6.0.0

setPageStep

public void setPageStep(int step)
Set page step.

Parameters:
step - The minimum step used for paging forward or backward.
Since:
BlackBerry API 6.0.0

setStepSize

public void setStepSize(int step)
Set step size.

Parameters:
step - The step size used for increments between lower and upper.
Since:
BlackBerry API 6.0.0

setUpper

public void setUpper(int upper)
Set upper limit.

Parameters:
upper - The max value.
Since:
BlackBerry API 6.0.0

setValue

public void setValue(int value)
Set current value.

Parameters:
value - The new value.
Since:
BlackBerry API 6.0.0

stepDown

public void stepDown()
Decrement Adjustment by step amount.

Since:
BlackBerry API 6.0.0

stepUp

public void stepUp()
Increment Adjustment by step amount.

Since:
BlackBerry API 6.0.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal