FileDocCategorySizeDatePackage
RateRange.javaAPI DocJMF 2.1.1e2645Mon May 12 12:20:42 BST 2003javax.media.protocol

RateRange

public class RateRange extends Object implements Serializable
Describes the speed at which data flows.
version
1.4, 02/08/21.

Fields Summary
float
minimum
float
maximum
float
current
boolean
exact
Constructors Summary
RateRange()

	super();
    
public RateRange(RateRange r)
Copy constructor.

	minimum = r.minimum;
	maximum = r.maximum;
	current = r.current;
	exact = r.exact;
    
public RateRange(float init, float min, float max, boolean isExact)
Constructor using required values.

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

	minimum = min;
	maximum = max;
	current = init;
	exact = isExact;
    
Methods Summary
public floatgetCurrentRate()
Get the current rate.

return
The current rate.

	return current;
    
public floatgetMaximumRate()
Get the maximum rate supported by this range.

return
The maximum rate.

	return maximum;
    
public floatgetMinimumRate()
Get the minimum rate supported by this range.

return
The minimum rate.

	return minimum;
    
public booleaninRange(float rate)
Determine whether or not a particular value is within the range of supported rates.

param
The rate to test.
return
Returns true if the specified rate is supported.

	return (minimum < rate) && (rate < maximum);
    
public booleanisExact()
Determine whether or not the source will maintain a constant speed when using this rate. If the rate varies, synchronization is usually impractical.

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

	return exact;
    
public floatsetCurrentRate(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.

param
rate The new rate.

	current = rate;
	return current;