本文整理匯總了Java中javax.jms.MapMessage.getDouble方法的典型用法代碼示例。如果您正苦於以下問題:Java MapMessage.getDouble方法的具體用法?Java MapMessage.getDouble怎麽用?Java MapMessage.getDouble使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.jms.MapMessage
的用法示例。
在下文中一共展示了MapMessage.getDouble方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: receiveMapMessage
import javax.jms.MapMessage; //導入方法依賴的package包/類
private void receiveMapMessage(boolean useCore) throws Exception {
MapMessage mapMessage = (MapMessage) receiveMessage(useCore);
boolean booleanVal = mapMessage.getBoolean("boolean-type");
assertTrue(booleanVal);
byte byteVal = mapMessage.getByte("byte-type");
assertEquals((byte) 10, byteVal);
byte[] bytesVal = mapMessage.getBytes("bytes-type");
byte[] originVal = TEXT.getBytes();
assertEquals(originVal.length, bytesVal.length);
for (int i = 0; i < bytesVal.length; i++) {
assertTrue(bytesVal[i] == originVal[i]);
}
char charVal = mapMessage.getChar("char-type");
assertEquals('A', charVal);
double doubleVal = mapMessage.getDouble("double-type");
assertEquals(55.3D, doubleVal, 0.1D);
float floatVal = mapMessage.getFloat("float-type");
assertEquals(79.1F, floatVal, 0.1F);
int intVal = mapMessage.getInt("int-type");
assertEquals(37, intVal);
long longVal = mapMessage.getLong("long-type");
assertEquals(56652L, longVal);
Object objectVal = mapMessage.getObject("object-type");
Object origVal = new String("VVVV");
assertTrue(objectVal.equals(origVal));
short shortVal = mapMessage.getShort("short-type");
assertEquals((short) 333, shortVal);
String strVal = mapMessage.getString("string-type");
assertEquals(TEXT, strVal);
}