本文整理了Java中com.thomsonreuters.ema.access.Key.buffer()
方法的一些代码示例,展示了Key.buffer()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Key.buffer()
方法的具体详情如下:
包路径:com.thomsonreuters.ema.access.Key
类名称:Key
方法名:buffer
[英]Returns the current OMM data represented as a specific simple type.
[中]返回表示为特定简单类型的当前OMM数据。
代码示例来源:origin: Refinitiv/Elektron-SDK
void decode(Map map)
{
if (DataTypes.FIELD_LIST == map.summaryData().dataType())
{
System.out.println("Map Summary data:");
decode(map.summaryData().fieldList());
System.out.println();
}
for (MapEntry mapEntry : map)
{
if (DataTypes.BUFFER == mapEntry.key().dataType())
System.out.println("Action: " + mapEntry.mapActionAsString() + " key value: " + EmaUtility.asHexString(mapEntry.key().buffer().buffer()));
if (DataTypes.FIELD_LIST == mapEntry.loadType())
{
System.out.println("Entry data:");
decode(mapEntry.fieldList());
System.out.println();
}
}
}
代码示例来源:origin: Refinitiv/Elektron-SDK
void decode(Map map)
{
if (DataTypes.FIELD_LIST == map.summaryData().dataType())
{
System.out.println("Map Summary data:");
decode(map.summaryData().fieldList());
System.out.println();
}
for (MapEntry mapEntry : map)
{
if (DataTypes.BUFFER == mapEntry.key().dataType())
System.out.println("Action: " + mapEntry.mapActionAsString() + " key value: " + EmaUtility.asHexString(mapEntry.key().buffer().buffer()));
if (DataTypes.FIELD_LIST == mapEntry.loadType())
{
System.out.println("Entry data:");
decode(mapEntry.fieldList());
System.out.println();
}
}
}
代码示例来源:origin: Refinitiv/Elektron-SDK
void decode(Map map)
{
if (DataTypes.FIELD_LIST == map.summaryData().dataType())
{
System.out.println("Map Summary data:");
decode(map.summaryData().fieldList());
System.out.println();
}
for (MapEntry mapEntry : map)
{
if (DataTypes.BUFFER == mapEntry.key().dataType())
System.out.println("Action: " + mapEntry.mapActionAsString() + " key value: " + EmaUtility.asHexString(mapEntry.key().buffer().buffer()));
if (DataTypes.FIELD_LIST == mapEntry.loadType())
{
System.out.println("Entry data:");
decode(mapEntry.fieldList());
System.out.println();
}
}
}
}
代码示例来源:origin: Refinitiv/Elektron-SDK
System.out.println(mapEntry.key().buffer() + "\t" + mapEntry.mapActionAsString());
break;
case DataTypes.ASCII :
代码示例来源:origin: Refinitiv/Elektron-SDK
TestUtilities.checkResult( mapEntryA.key().buffer().buffer().equals(keyBuffer1), "Check the key value of the first map entry");
TestUtilities.checkResult( mapEntryA.action() == MapEntry.MapAction.ADD, "Check the action of the first map entry");
TestUtilities.checkResult( mapEntryA.loadType() == DataTypes.NO_DATA, "Check the load type of the first map entry");
TestUtilities.checkResult( mapEntryA.load().dataType() == DataTypes.NO_DATA, "Get load and check data type of the first map entry");
TestUtilities.checkResult( mapEntryA.hasPermissionData() == false, "Check wheter the first map entry has permission data");
TestUtilities.checkResult( EmaUtility.asAsciiString(mapEntryA.key().buffer()).equals("KeyBuffer1") == true, "Check if EmaUtility.asAsciiString converts the string correctly" );
MapEntry mapEntryB = mapIt.next();
TestUtilities.checkResult( mapEntryB.key().buffer().buffer().equals(keyBuffer2), "Check the key value of the second map entry");
TestUtilities.checkResult( mapEntryB.action() == MapEntry.MapAction.UPDATE, "Check the action of the second map entry");
TestUtilities.checkResult( mapEntryB.loadType() == DataTypes.NO_DATA, "Check the load type of the second map entry");
TestUtilities.checkResult( mapEntryB.hasPermissionData(), "Check wheter the second map entry has permission data");
TestUtilities.checkResult( mapEntryB.permissionData().equals(permissionData) == true, "Compare the permission data of the second map entry");
TestUtilities.checkResult( EmaUtility.asAsciiString(mapEntryB.key().buffer()).equals("KeyBuffer2") == true, "Check if EmaUtility.asAsciiString converts the string correctly" );
MapEntry mapEntryC = mapIt.next();
TestUtilities.checkResult( mapEntryC.key().buffer().buffer().equals(keyBuffer3), "Check the key value of the third map entry");
TestUtilities.checkResult( mapEntryC.action() == MapEntry.MapAction.DELETE, "Check the action of the third map entry");
TestUtilities.checkResult( mapEntryC.loadType() == DataTypes.NO_DATA, "Check the load type of the third map entry");
TestUtilities.checkResult( mapEntryC.load().dataType() == DataTypes.NO_DATA, "Get load and check data type of the second map entry");
TestUtilities.checkResult( mapEntryC.hasPermissionData() == false, "Check wheter the third map entry has permission data");
TestUtilities.checkResult( EmaUtility.asAsciiString(mapEntryC.key().buffer()).equals("KeyBuffer3") == true, "Check if EmaUtility.asAsciiString converts the string correctly" );
MapEntry mapEntryD = mapIt.next();
TestUtilities.checkResult( mapEntryD.key().buffer().buffer().equals(keyBuffer4), "Check the key value of the third map entry");
TestUtilities.checkResult( mapEntryD.action() == MapEntry.MapAction.DELETE, "Check the action of the third map entry");
TestUtilities.checkResult( mapEntryD.loadType() == DataTypes.NO_DATA, "Check the load type of the third map entry");
TestUtilities.checkResult( EmaUtility.asAsciiString(mapEntryD.key().buffer()).equals("ËÃÄÅÇÈÉÊÒÓ") == false, "Check if EmaUtility.asAsciiString converts the string correctly with ISO-8859-1 charset" );
TestUtilities.checkResult( EmaUtility.asString(mapEntryD.key().buffer(), Charset.forName("ISO-8859-1")).equals(new String("ËÃÄÅÇÈÉÊÒÓ".getBytes(Charset.forName("ISO-8859-1")), Charset.forName("ISO-8859-1"))) == true, "Check if EmaUtility.asAsciiString converts the string correctly with ISO-8859-1 charset" );
代码示例来源:origin: Refinitiv/Elektron-SDK
checkResult( Arrays.equals(me1.key().buffer().buffer().array() , new String("ABCD").getBytes()), "MapEntry::getKey().buffer()" );
checkResult( Arrays.equals(me2.key().buffer().buffer().array() , new String("ABCD").getBytes()),"MapEntry::getKey().buffer()");
checkResult( Arrays.equals(me3.key().buffer().buffer().array() , new String("EFGHI").getBytes()), "MapEntry::getKey().buffer()" );
checkResult( Arrays.equals(me4.key().buffer().buffer().array() , new String("JKLMNOP").getBytes()), "MapEntry::getKey().buffer()" );
代码示例来源:origin: Refinitiv/Elektron-SDK
TestUtilities.checkResult( Arrays.equals( me1.key().buffer().buffer().array() , new String("ABCD").getBytes()), "MapEntry.key().buffer()" );
TestUtilities.checkResult( me1.action() == MapEntry.MapAction.DELETE, "MapEntry.action() == MapEntry.MapAction.DELETE" );
TestUtilities.checkResult( me1.load().dataType() == DataTypes.NO_DATA, "MapEntry.load().dataType() == DataTypes.NO_DATA" );
TestUtilities.checkResult( Arrays.equals( me1.key().buffer().buffer().array() , new String("ABCD").getBytes()), "MapEntry.key().buffer()" );
TestUtilities.checkResult( me1.action() == MapEntry.MapAction.DELETE, "MapEntry.action() == MapEntry.MapAction.DELETE" );
TestUtilities.checkResult( me1.load().dataType() == DataTypes.NO_DATA, "MapEntry.load().dataType() == DataTypes.NO_DATA" );
TestUtilities.checkResult( Arrays.equals( me1.key().buffer().buffer().array() , new String("ABCD").getBytes()), "MapEntry.key().buffer()" );
TestUtilities.checkResult( me2.action() == MapEntry.MapAction.ADD, "MapEntry.action() == MapEntry.MapAction.ADD" );
TestUtilities.checkResult( me2.load().dataType() == DataType.DataTypes.FIELD_LIST, "MapEntry.load().dataType() == DataType.DataTypes.FIELD_LIST" );
TestUtilities.checkResult( Arrays.equals( me3.key().buffer().buffer().array() , new String("EFGHI").getBytes()), "MapEntry.key().buffer()" );
TestUtilities.checkResult( me3.action() == MapEntry.MapAction.ADD, "MapEntry.action() == MapEntry.MapAction.ADD" );
TestUtilities.checkResult( me3.load().dataType() == DataType.DataTypes.FIELD_LIST, "MapEntry.load().dataType() == DataTypes.NO_DATA" );
TestUtilities.checkResult( Arrays.equals( me4.key().buffer().buffer().array() , new String("JKLMNOP").getBytes()), "MapEntry.key().buffer()" );
TestUtilities.checkResult( me4.action() == MapEntry.MapAction.UPDATE, "MapEntry.action() == MapEntry.MapAction.UPDATE" );
TestUtilities.checkResult( me4.load().dataType() == DataType.DataTypes.FIELD_LIST, "MapEntry.load().dataType() == DataType.DataTypes.FIELD_LIST" );
代码示例来源:origin: Refinitiv/Elektron-SDK
TestUtilities.checkResult( Arrays.equals( me1.key().buffer().buffer().array() , new String("ABCD").getBytes()), "MapEntry.key().buffer()" );
TestUtilities.checkResult( me1.action() == MapEntry.MapAction.DELETE, "MapEntry.action() == MapEntry.MapAction.DELETE" );
TestUtilities.checkResult( me1.load().dataType() == DataTypes.NO_DATA, "MapEntry.load().dataType() == DataTypes.NO_DATA" );
TestUtilities.checkResult( Arrays.equals( me2.key().buffer().buffer().array() , new String("ABCD").getBytes()), "MapEntry.key().buffer()" );
TestUtilities.checkResult( me2.action() == MapEntry.MapAction.ADD, "MapEntry.action() == MapEntry.MapAction.ADD" );
TestUtilities.checkResult( me2.load().dataType() == DataType.DataTypes.ELEMENT_LIST, "MapEntry.load().dataType() == DataType.DataTypes.FIELD_LIST" );
TestUtilities.checkResult( Arrays.equals( me3.key().buffer().buffer().array() , new String("EFGHI").getBytes()), "MapEntry.key().buffer()" );
TestUtilities.checkResult( me3.action() == MapEntry.MapAction.ADD, "MapEntry.action() == MapEntry.MapAction.ADD" );
TestUtilities.checkResult( me3.load().dataType() == DataType.DataTypes.ELEMENT_LIST, "MapEntry.load().dataType() == DataTypes.NO_DATA" );
TestUtilities.checkResult( Arrays.equals( me4.key().buffer().buffer().array() , new String("JKLMNOP").getBytes()), "MapEntry.key().buffer()" );
TestUtilities.checkResult( me4.action() == MapEntry.MapAction.UPDATE, "MapEntry.action() == MapEntry.MapAction.UPDATE" );
TestUtilities.checkResult( me4.load().dataType() == DataType.DataTypes.ELEMENT_LIST, "MapEntry.load().dataType() == DataType.DataTypes.FIELD_LIST" );
代码示例来源:origin: Refinitiv/Elektron-SDK
keyData.data("keyData1");
ByteBuffer expectedByteBuffer1 = keyData.data();
TestUtilities.checkResult(Arrays.equals(me1.key().buffer().asHex().array(), expectedByteBuffer1.array()));
me1 = mapIter.next();
TestUtilities.checkResult(me1.key().dataType(), DataType.DataTypes.BUFFER);
TestUtilities.checkResult(Arrays.equals(me1.key().buffer().asHex().array(), expectedByteBuffer1.array()));
TestUtilities.checkResult(me1.action(), MapEntry.MapAction.UPDATE);
TestUtilities.checkResult(me1.load().dataType(), DataType.DataTypes.FIELD_LIST);
TestUtilities.checkResult(Arrays.equals(me2.key().buffer().buffer().array(), expectedByteBuffer2.array()));
TestUtilities.checkResult(Arrays.equals(me3.key().buffer().buffer().array(), expectedByteBuffer3.array()));
代码示例来源:origin: Refinitiv/Elektron-SDK
MapEntry me1a = summaryIter.next();
TestUtilities.checkResult( me1a.key().dataType() == DataType.DataTypes.BUFFER, "MapEntry.key().dataType() == DataType.DataTypes.BUFFER" );
TestUtilities.checkResult( Arrays.equals( me1a.key().buffer().buffer().array() , new String("ABCD").getBytes()), "MapEntry.key().buffer()" );
TestUtilities.checkResult( me1a.action() == MapEntry.MapAction.DELETE, "MapEntry.action() == MapEntry.MapAction.DELETE" );
TestUtilities.checkResult( me1a.load().dataType() == DataTypes.NO_DATA, "MapEntry.load().dataType() == DataTypes.NO_DATA" );
TestUtilities.checkResult( Arrays.equals( me2a.key().buffer().buffer().array() , new String("ABCD").getBytes()), "MapEntry.key().buffer()" );
TestUtilities.checkResult( me2a.action() == MapEntry.MapAction.ADD, "MapEntry.action() == MapEntry.MapAction.ADD" );
TestUtilities.checkResult( me2a.load().dataType() == DataType.DataTypes.FIELD_LIST, "MapEntry.load().dataType() == DataType.DataTypes.FIELD_LIST" );
TestUtilities.checkResult( Arrays.equals( me3a.key().buffer().buffer().array() , new String("EFGHI").getBytes()), "MapEntry.key().buffer()" );
TestUtilities.checkResult( me3a.action() == MapEntry.MapAction.ADD, "MapEntry.action() == MapEntry.MapAction.ADD" );
TestUtilities.checkResult( me3a.load().dataType() == DataType.DataTypes.FIELD_LIST, "MapEntry.load().dataType() == DataTypes.NO_DATA" );
TestUtilities.checkResult( Arrays.equals( me4a.key().buffer().buffer().array() , new String("JKLMNOP").getBytes()), "MapEntry.key().buffer()" );
TestUtilities.checkResult( me4a.action() == MapEntry.MapAction.UPDATE, "MapEntry.action() == MapEntry.MapAction.UPDATE" );
TestUtilities.checkResult( me4a.load().dataType() == DataType.DataTypes.FIELD_LIST, "MapEntry.load().dataType() == DataType.DataTypes.FIELD_LIST" );
TestUtilities.checkResult( Arrays.equals( me1.key().buffer().buffer().array() , new String("ABCD").getBytes()), "MapEntry.key().buffer()" );
TestUtilities.checkResult( me1.action() == MapEntry.MapAction.DELETE, "MapEntry.action() == MapEntry.MapAction.DELETE" );
TestUtilities.checkResult( me1.load().dataType() == DataTypes.NO_DATA, "MapEntry.load().dataType() == DataTypes.NO_DATA" );
TestUtilities.checkResult( Arrays.equals( me1.key().buffer().buffer().array() , new String("ABCD").getBytes()), "MapEntry.key().buffer()" );
TestUtilities.checkResult( me1.action() == MapEntry.MapAction.DELETE, "MapEntry.action() == MapEntry.MapAction.DELETE" );
TestUtilities.checkResult( me1.load().dataType() == DataTypes.NO_DATA, "MapEntry.load().dataType() == DataTypes.NO_DATA" );
TestUtilities.checkResult( Arrays.equals( me2.key().buffer().buffer().array() , new String("ABCD").getBytes()), "MapEntry.key().buffer()" );
TestUtilities.checkResult( me2.action() == MapEntry.MapAction.ADD, "MapEntry.action() == MapEntry.MapAction.DELETE" );
TestUtilities.checkResult( me2.load().dataType() == DataTypes.MAP, "MapEntry.load().dataType() == DataTypes.NO_DATA" );
代码示例来源:origin: Refinitiv/Elektron-SDK
break;
case DataTypes.BUFFER :
System.out.println("Action = " + mapEntry.mapActionAsString() + ", key = " + mapEntry.key().buffer());
break;
default:
代码示例来源:origin: Refinitiv/Elektron-SDK
MapEntry me1a = mapIter.next();
TestUtilities.checkResult("MapEntry.key().dataType()== DataTypes.BUFFER", me1a.key().dataType()== DataTypes.BUFFER );
TestUtilities.checkResult("MapEntry.key().buffer()", Arrays.equals( me1a.key().buffer().buffer().array() , new String("ABCD").getBytes()));
TestUtilities.checkResult("MapEntry.action() == MapEntry.Action.DELETE", me1a.action() == MapEntry.MapAction.DELETE );
TestUtilities.checkResult("MapEntry.load().dataType()== DataTypes.NO_DATA", me1a.load().dataType()== DataTypes.NO_DATA );
MapEntry me3a = mapIter.next();
TestUtilities.checkResult("MapEntry.key().dataType()== DataTypes.BUFFER", me3a.key().dataType()== DataTypes.BUFFER );
TestUtilities.checkResult("MapEntry.key().buffer()", Arrays.equals(me3a.key().buffer().buffer().array() , new String("EFGHI").getBytes()));
TestUtilities.checkResult("MapEntry.action() == MapEntry.MapAction.ADD", me3a.action() == MapEntry.MapAction.ADD );
TestUtilities.checkResult("MapEntry.load().dataType()== DataTypes.ELEMENT_LIST", me3a.load().dataType()== DataTypes.ELEMENT_LIST );
MapEntry me4a = mapIter.next();
TestUtilities.checkResult("MapEntry.key().dataType()== DataTypes.BUFFER", me4a.key().dataType()== DataTypes.BUFFER );
TestUtilities.checkResult("MapEntry.key().buffer()" ,Arrays.equals( me4a.key().buffer().buffer().array() , new String("JKLMNOP").getBytes()));
TestUtilities.checkResult("MapEntry.action() == MapEntry.MapAction.UPDATE", me4a.action() == MapEntry.MapAction.UPDATE );
TestUtilities.checkResult("MapEntry.load().dataType()== DataTypes.ELEMENT_LIST", me4a.load().dataType()== DataTypes.ELEMENT_LIST );
代码示例来源:origin: Refinitiv/Elektron-SDK
MapEntry me1a = mapIter.next();
TestUtilities.checkResult("MapEntry.key().dataType()== DataTypes.BUFFER", me1a.key().dataType()== DataTypes.BUFFER );
TestUtilities.checkResult("MapEntry.key().buffer()", Arrays.equals( me1a.key().buffer().buffer().array() , new String("ABCD").getBytes()));
TestUtilities.checkResult("MapEntry.action() == MapEntry.Action.DELETE", me1a.action() == MapEntry.MapAction.DELETE );
TestUtilities.checkResult("MapEntry.load().dataType()== DataTypes.NO_DATA", me1a.load().dataType()== DataTypes.NO_DATA );
MapEntry me3a = mapIter.next();
TestUtilities.checkResult("MapEntry.key().dataType()== DataTypes.BUFFER", me3a.key().dataType()== DataTypes.BUFFER );
TestUtilities.checkResult("MapEntry.key().buffer()", Arrays.equals(me3a.key().buffer().buffer().array() , new String("EFGHI").getBytes()));
TestUtilities.checkResult("MapEntry.action() == MapEntry.MapAction.ADD", me3a.action() == MapEntry.MapAction.ADD );
TestUtilities.checkResult("MapEntry.load().dataType()== DataTypes.FIELD_LIST", me3a.load().dataType()== DataTypes.FIELD_LIST );
MapEntry me4a = mapIter.next();
TestUtilities.checkResult("MapEntry.key().dataType()== DataTypes.BUFFER", me4a.key().dataType()== DataTypes.BUFFER );
TestUtilities.checkResult("MapEntry.key().buffer()" ,Arrays.equals( me4a.key().buffer().buffer().array() , new String("JKLMNOP").getBytes()));
TestUtilities.checkResult("MapEntry.action() == MapEntry.MapAction.UPDATE", me4a.action() == MapEntry.MapAction.UPDATE );
TestUtilities.checkResult("MapEntry.load().dataType()== DataTypes.FIELD_LIST", me4a.load().dataType()== DataTypes.FIELD_LIST );
内容来源于网络,如有侵权,请联系作者删除!