public abstract class CoreTypeFcns extends Object
| Constructor and Description |
|---|
CoreTypeFcns() |
| Modifier and Type | Method and Description |
|---|---|
static Object |
attributeConvert(DapType type,
Object value)
Force an attribute value (typically string)
to match a given basetype
|
static Object |
createVector(TypeSort type,
long count) |
static long |
forceRange(TypeSort basetype,
long value)
Force a numeric value to be in a specified range
Only defined for simple integers (ValueClass LONG)
WARNING: unsigned values are forced into the
signed size, but the proper bit pattern is maintained.
|
static Object |
get(DapType type,
Object v,
int n) |
static Object |
get(TypeSort sort,
ByteBuffer b,
int n) |
static int |
getJavaSize(TypeSort atomtype) |
protected static long |
minmax(long value,
long min,
long max)
Peg a value to either the min or max
depending on sign.
|
static void |
put(TypeSort sort,
Object v,
int n,
Object value) |
static int |
putVector(TypeSort sort,
Object v,
int offset,
Object vec) |
public static Object attributeConvert(DapType type, Object value)
type - expected typevalue - actual valuepublic static int getJavaSize(TypeSort atomtype)
public static long forceRange(TypeSort basetype, long value)
basetype - the type to force value to in rangevalue - the value to forceConversionException - if forcing is not possibleprotected static long minmax(long value,
long min,
long max)
value - the value to pegmin - peg to this if value is < minmax - peg to this if value is > maxpublic static Object get(TypeSort sort, ByteBuffer b, int n)