Package dap4.core.dmr
Class DapEnumeration
- java.lang.Object
-
- dap4.core.dmr.DapNode
-
- dap4.core.dmr.DapType
-
- dap4.core.dmr.DapEnumeration
-
-
Field Summary
Fields Modifier and Type Field Description protected DapTypebasetypeprotected List<DapEnumConst>constantsThe enumeration constants are represented by a List of names since order is important at least for printing, and a pair of maps.static DapTypeDEFAULTBASETYPE-
Fields inherited from class dap4.core.dmr.DapType
CHAR, FLOAT32, FLOAT64, INT16, INT32, INT64, INT8, OPAQUE, pseudoroot, SEQUENCE, STRING, STRUCTURE, typesort, UINT16, UINT32, UINT64, UINT8, URL
-
Fields inherited from class dap4.core.dmr.DapNode
annotations, attributes, dataset, escapedname, fqn, index, parent, shortname, sort, xmlattributes
-
-
Constructor Summary
Constructors Constructor Description DapEnumeration(String name)DapEnumeration(String name, DapType basetype)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEnumConst(DapEnumConst dec)String[]convert(long[] lvalues)String[]convert(String[] vec)Convert a string vector of int strings mixed with econst names to a set of longs onlyDapNodefindByName(String name)DapTypegetBaseType()List<DapEnumConst>getEnumConsts()List<String>getNames()DapEnumConstlookup(long value)DapEnumConstlookup(String name)static booleansame(DapEnumeration enum1, DapEnumeration enum2)voidsetBaseType(DapType basetype)voidsetEnumConsts(List<DapEnumConst> econsts)-
Methods inherited from class dap4.core.dmr.DapType
getAtomicType, getSize, getTypeName, getTypeSort, isAtomic, isCharType, isCompound, isCompoundType, isEnumType, isFixedSize, isFloatType, isIntegerType, isLegalAttrType, isNumericType, isOpaqueType, isSeqType, isStringType, isStructType, isUnsigned, lookup, setTypeSort, vector, vectorget
-
Methods inherited from class dap4.core.dmr.DapNode
addAttribute, addXMLAttribute, annotate, annotation, computefqn, findAttribute, getAttributes, getContainer, getContainerPath, getDataset, getEscapedShortName, getFQN, getGroup, getGroupPath, getIndex, getParent, getPath, getShortName, getSort, getXMLAttributes, isTopLevel, overrideParent, removeAttribute, removeXMLAttribute, setAttribute, setAttributes, setDataset, setIndex, setParent, setShortName, setSort, toString
-
-
-
-
Field Detail
-
DEFAULTBASETYPE
public static final DapType DEFAULTBASETYPE
-
basetype
protected DapType basetype
-
constants
protected List<DapEnumConst> constants
The enumeration constants are represented by a List of names since order is important at least for printing, and a pair of maps.
-
-
Method Detail
-
same
public static boolean same(DapEnumeration enum1, DapEnumeration enum2)
-
getBaseType
public DapType getBaseType()
-
getEnumConsts
public List<DapEnumConst> getEnumConsts()
-
setBaseType
public void setBaseType(DapType basetype)
-
setEnumConsts
public void setEnumConsts(List<DapEnumConst> econsts) throws DapException
- Throws:
DapException
-
addEnumConst
public void addEnumConst(DapEnumConst dec) throws DapException
- Throws:
DapException
-
lookup
public DapEnumConst lookup(String name)
-
lookup
public DapEnumConst lookup(long value)
-
convert
public String[] convert(String[] vec) throws ConversionException
Convert a string vector of int strings mixed with econst names to a set of longs only- Parameters:
vec- vector of int strings mixed with econst names- Returns:
- converted vector
- Throws:
ConversionException
-
convert
public String[] convert(long[] lvalues) throws ConversionException
- Throws:
ConversionException
-
-