Package com.softsynth.jmsl
Class DimensionNameSpaceAdapter
java.lang.Object
com.softsynth.jmsl.DimensionNameSpaceAdapter
- All Implemented Interfaces:
DimensionNameSpace
- Direct Known Subclasses:
MaxDimensionNameSpace
public class DimensionNameSpaceAdapter extends java.lang.Object implements DimensionNameSpace
General implementation of DimensionNameSpace
- Author:
- Nick Didkovsky. (c) 2002 Nick Didkovsky and Phil Burk, all rights reserved.
-
Constructor Summary
Constructors Constructor Description DimensionNameSpaceAdapter() -
Method Summary
Modifier and Type Method Description intdimension()java.util.EnumerationdimensionNames()doublegetDefault(int dim)intgetDimension(java.lang.String name)java.lang.StringgetDimensionName(int dim)doublegetHighLimit(int dim)return highest allowable value for specified dimensiondoublegetLowLimit(int dim)return lowest allowable value for specified dimensionintgetNumberOfNames()static voidmain(java.lang.String[] args)voidsetDefault(int dim, double value)set the default value for a dimensionvoidsetDimensionName(int dim, java.lang.String name)assign a name to a dimensionvoidsetLimits(int dim, double low, double high)set the lowest and highest limits for a dimensionMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
DimensionNameSpaceAdapter
public DimensionNameSpaceAdapter()
-
-
Method Details
-
getNumberOfNames
public int getNumberOfNames()- Specified by:
getNumberOfNamesin interfaceDimensionNameSpace- Returns:
- number of names stored in name space. Not the same as highest dimension. Not all dimensions require names.
-
dimension
public int dimension()- Specified by:
dimensionin interfaceDimensionNameSpace- Returns:
- number of dimensions + 1. Useful if you are allocating an array for example
-
getDimensionName
public java.lang.String getDimensionName(int dim)- Specified by:
getDimensionNamein interfaceDimensionNameSpace- Returns:
- name of specified dimension
-
getDimension
public int getDimension(java.lang.String name)- Specified by:
getDimensionin interfaceDimensionNameSpace- Returns:
- dimension associated with name or -1
-
setDimensionName
public void setDimensionName(int dim, java.lang.String name)assign a name to a dimension- Specified by:
setDimensionNamein interfaceDimensionNameSpace
-
getLowLimit
public double getLowLimit(int dim)return lowest allowable value for specified dimension- Specified by:
getLowLimitin interfaceDimensionNameSpace- Returns:
- lowest allowable value for specified dimension
-
getHighLimit
public double getHighLimit(int dim)return highest allowable value for specified dimension- Specified by:
getHighLimitin interfaceDimensionNameSpace- Returns:
- highest allowable value for specified dimension
-
setLimits
public void setLimits(int dim, double low, double high)set the lowest and highest limits for a dimension- Specified by:
setLimitsin interfaceDimensionNameSpace
-
setDefault
public void setDefault(int dim, double value)Description copied from interface:DimensionNameSpaceset the default value for a dimension- Specified by:
setDefaultin interfaceDimensionNameSpace
-
getDefault
public double getDefault(int dim)- Specified by:
getDefaultin interfaceDimensionNameSpace- Returns:
- default value for specified dimension
-
dimensionNames
public java.util.Enumeration dimensionNames()- Specified by:
dimensionNamesin interfaceDimensionNameSpace
-
main
public static void main(java.lang.String[] args)
-