javax.media.protocol
Class RateRange

java.lang.Object
  |
  +--javax.media.protocol.RateRange
All Implemented Interfaces:
java.io.Serializable

public class RateRange
extends java.lang.Object
implements java.io.Serializable

Describes the speed at which data flows.

Version:
1.4, 02/08/21.
See Also:
Serialized Form

Field Summary
(package private)  float current
           
(package private)  boolean exact
           
(package private)  float maximum
           
(package private)  float minimum
           
 
Constructor Summary
(package private) RateRange()
           
  RateRange(float init, float min, float max, boolean isExact)
          Constructor using required values.
  RateRange(RateRange r)
          Copy constructor.
 
Method Summary
 float getCurrentRate()
          Get the current rate.
 float getMaximumRate()
          Get the maximum rate supported by this range.
 float getMinimumRate()
          Get the minimum rate supported by this range.
 boolean inRange(float rate)
          Determine whether or not a particular value is within the range of supported rates.
 boolean isExact()
          Determine whether or not the source will maintain a constant speed when using this rate.
 float setCurrentRate(float rate)
          Set the current rate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

minimum

float minimum

maximum

float maximum

current

float current

exact

boolean exact
Constructor Detail

RateRange

RateRange()

RateRange

public RateRange(RateRange r)
Copy constructor.


RateRange

public RateRange(float init,
                 float min,
                 float max,
                 boolean isExact)
Constructor using required values.

Parameters:
init - The initial value for this rate.
min - The minimum value that this rate can take.
max - The maximum value that this rate can take.
isExact - Set to true if the source rate does not vary when using this rate range.
Method Detail

setCurrentRate

public float setCurrentRate(float rate)
Set the current rate. Returns the rate that was actually set. This implementation just returns the specified rate, subclasses should return the rate that was actually set.

Parameters:
rate - The new rate.

getCurrentRate

public float getCurrentRate()
Get the current rate.

Returns:
The current rate.

getMinimumRate

public float getMinimumRate()
Get the minimum rate supported by this range.

Returns:
The minimum rate.

getMaximumRate

public float getMaximumRate()
Get the maximum rate supported by this range.

Returns:
The maximum rate.

inRange

public boolean inRange(float rate)
Determine whether or not a particular value is within the range of supported rates.

Returns:
Returns true if the specified rate is supported.

isExact

public boolean isExact()
Determine whether or not the source will maintain a constant speed when using this rate. If the rate varies, synchronization is usually impractical.

Returns:
Returns true if the source will maintain a constant speed at this rate.