public class NumberItemType extends ItemType<NumberItemType>
| 构造器和说明 |
|---|
NumberItemType(int bytes,
int bits,
String name) |
NumberItemType(int bytes,
String name) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
addSubitemImpl(Item item,
Object subitemValue) |
int |
allBits() |
static NumberItemType |
BCD(int bytes,
String name) |
NumberItemType |
bit(int bitIndex,
String trueNote) |
int |
bits() |
NumberItemType |
bits(int lowBitIndex,
int highBitIndex,
Object... map)
调用例子: bits(8, 9, 0b00, "空车", 0b01,"半载", 0b10,"保留",
0b11,"满载");
|
int |
bytes() |
Item |
create() |
NumberItemType |
decoder(java.util.function.Function<Long,Long> decoder,
java.util.function.Function<Long,Long> encoder) |
NumberItemType |
defaultVal(long defaultVal) |
protected Item |
getSubitemImpl(Item item,
int key) |
protected Class |
insideValueClass() |
boolean |
isDoubleType() |
Item |
load(BytesLoader in) |
Item |
load(Scanner in)
允许从字符串载入数据(为数据库载入准备)
|
protected long |
objectToLong(Object itemValue) |
protected void |
safeSetItemValue(Item item,
Object newValue) |
int |
statementParamImpl(Item item,
CallableStatement statement,
int pos) |
void |
toBytes(Object itemValue,
BytesBuilder out) |
double |
toDouble(Object itemValue) |
double |
toDoubleImpl(Item item) |
String |
toString(Object itemValue) |
NumberItemType |
valueElseNote(String valueNote) |
NumberItemType |
valueNote(long val,
String valueNote) |
NumberItemType |
valueNote(Map<Long,String> valueNames) |
NumberItemType |
显示进制(int digits) |
NumberItemType |
小数位数(int len)
用于定点小数
|
_newItem, BCD_DATE, BCD_DATETIME, BIN, BITS, BYTES_ASC, BYTES, dbParamCount, DEC, description, description, flatItemTypes, formatFlatObjects, HEX, itemValue, LIST_H4, LIST, load, load, match, name, NUM, REMAIN_BYTES, setSubitemImpl, SNUM, STR, STRUCT, toBytes, toFlatObject, toString, toString, 包类型public NumberItemType(int bytes,
String name)
public NumberItemType(int bytes,
int bits,
String name)
public static NumberItemType BCD(int bytes, String name)
public int bytes()
public int bits()
public int allBits()
public NumberItemType valueNote(long val, String valueNote)
public NumberItemType valueElseNote(String valueNote)
public NumberItemType valueNote(Map<Long,String> valueNames)
public NumberItemType bit(int bitIndex, String trueNote)
public NumberItemType bits(int lowBitIndex, int highBitIndex, Object... map)
lowBitIndex - 低位索引highBitIndex - 包含本位map - pairspublic NumberItemType 小数位数(int len)
len - lengthpublic NumberItemType 显示进制(int digits)
public NumberItemType defaultVal(long defaultVal)
public Item create()
create 在类中 ItemType<NumberItemType>public Item load(Scanner in)
ItemTypeload 在类中 ItemType<NumberItemType>in - scannerpublic NumberItemType decoder(java.util.function.Function<Long,Long> decoder, java.util.function.Function<Long,Long> encoder)
decoder - 接收时,的解密encoder - 发送前的加密public Item load(BytesLoader in)
load 在类中 ItemType<NumberItemType>in - loaderprotected Class insideValueClass()
insideValueClass 在类中 ItemType<NumberItemType>protected void safeSetItemValue(Item item, Object newValue)
safeSetItemValue 在类中 ItemType<NumberItemType>item - itemnewValue - newValuepublic void toBytes(Object itemValue, BytesBuilder out)
toBytes 在类中 ItemType<NumberItemType>itemValue - itemValueout - builderprotected long objectToLong(Object itemValue)
itemValue - itemValuepublic double toDouble(Object itemValue)
public boolean isDoubleType()
public String toString(Object itemValue)
toString 在类中 ItemType<NumberItemType>itemValue - itemValuepublic int statementParamImpl(Item item, CallableStatement statement, int pos) throws SQLException
statementParamImpl 在类中 ItemType<NumberItemType>SQLExceptionpublic double toDoubleImpl(Item item)
toDoubleImpl 在类中 ItemType<NumberItemType>protected Item getSubitemImpl(Item item, int key)
getSubitemImpl 在类中 ItemType<NumberItemType>protected void addSubitemImpl(Item item, Object subitemValue)
addSubitemImpl 在类中 ItemType<NumberItemType>Copyright © 2022. All rights reserved.