org.apache.excalibur.instrument.manager
Class InstrumentSampleUtils

java.lang.Object
  extended byorg.apache.excalibur.instrument.manager.InstrumentSampleUtils

public class InstrumentSampleUtils
extends java.lang.Object

A series of methods which are useful when working with InstrumentSamples. These methods can be used on the server as well as the client.

Author:
Avalon Development Team

Constructor Summary
InstrumentSampleUtils()
           
 
Method Summary
static java.lang.String generateFullInstrumentSampleName(java.lang.String instrumentName, int sampleType, long sampleInterval, int sampleSize)
          Generates a fully qualified sample name given its parameters.
static java.lang.String generateInstrumentSampleName(int sampleType, long sampleInterval, int sampleSize)
          Generates a sample name given its parameters.
static java.lang.String getInstrumentSampleTypeName(int type)
           
static int resolveInstrumentSampleType(java.lang.String type)
          Resolves an instrument sample type based on a name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InstrumentSampleUtils

public InstrumentSampleUtils()
Method Detail

resolveInstrumentSampleType

public static int resolveInstrumentSampleType(java.lang.String type)
                                       throws ConfigurationException
Resolves an instrument sample type based on a name.

Parameters:
type - Type of the InstrumentSample to resolve. Accepted values are: "max", "maximum", "min", "minimum", "mean", "ctr", and "counter".
Throws:
ConfigurationException - if the specified sample type is unknown.

getInstrumentSampleTypeName

public static java.lang.String getInstrumentSampleTypeName(int type)

generateInstrumentSampleName

public static java.lang.String generateInstrumentSampleName(int sampleType,
                                                            long sampleInterval,
                                                            int sampleSize)
Generates a sample name given its parameters.

Parameters:
sampleType - Type of the sample.
sampleInterval - Interval of the sample.
sampleSize - Size of the sample.
Returns:
A sample name.

generateFullInstrumentSampleName

public static java.lang.String generateFullInstrumentSampleName(java.lang.String instrumentName,
                                                                int sampleType,
                                                                long sampleInterval,
                                                                int sampleSize)
Generates a fully qualified sample name given its parameters.

Parameters:
instrumentName - Name of the instrument which owns the sample.
sampleType - Type of the sample.
sampleInterval - Interval of the sample.
sampleSize - Size of the sample.
Returns:
A fully qualified sample name.


Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.