JThreadKitTM
v1.1.0
(public members only)

com.jthreadkit
Class ValueMonitor

java.lang.Object
  |
  +--com.jthreadkit.ValueMonitor

public final class ValueMonitor
extends Object

ValueMonitor is used internally by JThreadKit. You will only need to use this class on rare occasions when you need to access instances of it that have been constructed by a superclass you are extending.

The SyncInteger class offers similar functionality and should be used as an alternative.


Constructor Summary
ValueMonitor()
           
ValueMonitor(int initialValue, int minValue, int maxValue, Object lock, boolean useTimedOutException)
           
ValueMonitor(int minValue, int maxValue, Object lock)
           
ValueMonitor(Object lock)
           
 
Method Summary
 void addValueChangeListener(ValueChangeListener listener)
           
 int decreaseValueBy(int decrement)
           
 Object getLockObject()
           
 int getMaxValue()
           
 int getMinValue()
           
 int getValue()
           
 int increaseValueBy(int increment)
           
 boolean isMaxValue()
           
 boolean isMinValue()
           
 boolean isUseTimedOutExceptionSet()
           
 boolean isZero()
           
 boolean removeValueChangeListener(ValueChangeListener listener)
           
 void setMaxValue(int newMaxValue)
           
 void setMinValue(int newMinValue)
           
 void setUseTimedOutException(boolean useException)
           
 void setValue(int newValue)
           
 void setValueRange(int newMinValue, int newMaxValue)
           
 void shutdown()
           
 void shutdownCheck()
           
 String toString()
           
 boolean waitForValueToChange(long msTimeout)
           
 boolean waitForValueToClimbTo(int atLeast, long msTimeout)
           
 boolean waitForValueToFallTo(int atMost, long msTimeout)
           
 boolean waitUntilMaxValue(long msTimeout)
           
 boolean waitUntilMinValue(long msTimeout)
           
 boolean waitUntilValueInRange(int min, int max, long msTimeout)
           
 boolean waitUntilValueIs(int val, long msTimeout)
           
 boolean waitUntilZero(long msTimeout)
           
 boolean waitWhileMaxValue(long msTimeout)
           
 boolean waitWhileMinValue(long msTimeout)
           
 boolean waitWhileValueInRange(int min, int max, long msTimeout)
           
 boolean waitWhileValueIs(int val, long msTimeout)
           
 boolean waitWhileZero(long msTimeout)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ValueMonitor

public ValueMonitor(int initialValue,
                    int minValue,
                    int maxValue,
                    Object lock,
                    boolean useTimedOutException)
             throws IllegalArgumentException

ValueMonitor

public ValueMonitor(int minValue,
                    int maxValue,
                    Object lock)

ValueMonitor

public ValueMonitor(Object lock)

ValueMonitor

public ValueMonitor()
Method Detail

getValue

public int getValue()

setValue

public void setValue(int newValue)
              throws IllegalArgumentException,
                     ShutdownException

increaseValueBy

public int increaseValueBy(int increment)
                    throws IllegalArgumentException,
                           ShutdownException

decreaseValueBy

public int decreaseValueBy(int decrement)
                    throws IllegalArgumentException,
                           ShutdownException

setMinValue

public void setMinValue(int newMinValue)
                 throws IllegalArgumentException,
                        ShutdownException

getMinValue

public int getMinValue()

setMaxValue

public void setMaxValue(int newMaxValue)
                 throws IllegalArgumentException,
                        ShutdownException

getMaxValue

public int getMaxValue()

setValueRange

public void setValueRange(int newMinValue,
                          int newMaxValue)
                   throws IllegalArgumentException,
                          ShutdownException

setUseTimedOutException

public void setUseTimedOutException(boolean useException)
                             throws ShutdownException

isUseTimedOutExceptionSet

public boolean isUseTimedOutExceptionSet()

getLockObject

public Object getLockObject()

isMinValue

public boolean isMinValue()

isMaxValue

public boolean isMaxValue()

isZero

public boolean isZero()

waitUntilValueInRange

public boolean waitUntilValueInRange(int min,
                                     int max,
                                     long msTimeout)
                              throws InterruptedException,
                                     TimedOutException,
                                     ShutdownException,
                                     IllegalArgumentException

waitWhileValueInRange

public boolean waitWhileValueInRange(int min,
                                     int max,
                                     long msTimeout)
                              throws InterruptedException,
                                     TimedOutException,
                                     ShutdownException,
                                     IllegalArgumentException

waitForValueToChange

public boolean waitForValueToChange(long msTimeout)
                             throws InterruptedException,
                                    TimedOutException,
                                    ShutdownException

waitForValueToFallTo

public boolean waitForValueToFallTo(int atMost,
                                    long msTimeout)
                             throws InterruptedException,
                                    TimedOutException,
                                    ShutdownException

waitForValueToClimbTo

public boolean waitForValueToClimbTo(int atLeast,
                                     long msTimeout)
                              throws InterruptedException,
                                     TimedOutException,
                                     ShutdownException

waitWhileZero

public boolean waitWhileZero(long msTimeout)
                      throws InterruptedException,
                             TimedOutException,
                             ShutdownException

waitUntilZero

public boolean waitUntilZero(long msTimeout)
                      throws InterruptedException,
                             TimedOutException,
                             ShutdownException

waitWhileValueIs

public boolean waitWhileValueIs(int val,
                                long msTimeout)
                         throws InterruptedException,
                                TimedOutException,
                                ShutdownException

waitUntilValueIs

public boolean waitUntilValueIs(int val,
                                long msTimeout)
                         throws InterruptedException,
                                TimedOutException,
                                ShutdownException

waitWhileMaxValue

public boolean waitWhileMaxValue(long msTimeout)
                          throws InterruptedException,
                                 TimedOutException,
                                 ShutdownException

waitUntilMaxValue

public boolean waitUntilMaxValue(long msTimeout)
                          throws InterruptedException,
                                 TimedOutException,
                                 ShutdownException

waitWhileMinValue

public boolean waitWhileMinValue(long msTimeout)
                          throws InterruptedException,
                                 TimedOutException,
                                 ShutdownException

waitUntilMinValue

public boolean waitUntilMinValue(long msTimeout)
                          throws InterruptedException,
                                 TimedOutException,
                                 ShutdownException

shutdownCheck

public final void shutdownCheck()
                         throws ShutdownException

shutdown

public void shutdown()

addValueChangeListener

public void addValueChangeListener(ValueChangeListener listener)

removeValueChangeListener

public boolean removeValueChangeListener(ValueChangeListener listener)

toString

public String toString()
Overrides:
toString in class Object

JThreadKitTM
v1.1.0
(public members only)

© Copyright 2000-2001 Programix Incorporated. All rights reserved. JThreadKit home