org.apache.excalibur.instrument.client
Class InstrumentSampleUtils

java.lang.Object
  extended by org.apache.excalibur.instrument.client.InstrumentSampleUtils

public class InstrumentSampleUtils
extends Object

A series of methods which are useful when working with InstrumentSamples.

Since:
4.1
Version:
CVS $Revision: 1.4 $ $Date: 2004/02/28 11:47:19 $
Author:
Avalon Development Team

Constructor Summary
InstrumentSampleUtils()
           
 
Method Summary
static String generateFullInstrumentSampleName(String instrumentName, int sampleType, long sampleInterval, int sampleSize)
          Generates a fully qualified sample name given its parameters.
static String generateInstrumentSampleName(int sampleType, long sampleInterval, int sampleSize)
          Generates a sample name given its parameters.
static String getDefaultDescriptionForType(int type, long interval)
          Returns the default description for a given type.
static String getInstrumentSampleTypeName(int type)
           
static int resolveInstrumentSampleType(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(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 String getInstrumentSampleTypeName(int type)

generateInstrumentSampleName

public static 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 String generateFullInstrumentSampleName(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.

getDefaultDescriptionForType

public static String getDefaultDescriptionForType(int type,
                                                  long interval)
Returns the default description for a given type.

Parameters:
type - Whose description is being requested.
interval - Interval of the Sample.
Returns:
The description.


Copyright © 1997-2012 Apache Software Foundation. All Rights Reserved.