com.thomsonreuters.ema.access.Key类的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(20.6k)|赞(0)|评价(0)|浏览(175)

本文整理了Java中com.thomsonreuters.ema.access.Key类的一些代码示例,展示了Key类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Key类的具体详情如下:
包路径:com.thomsonreuters.ema.access.Key
类名称:Key

Key介绍

[英]Key conveys MapEntry key information.

Key contains objects of primitive type (e.g. they are not complex type).
[中]键传递地图输入键信息。
键包含基元类型的对象(例如,它们不是复杂类型)。

代码示例

代码示例来源:origin: Refinitiv/Elektron-SDK

if ( mapEntry.key().dataType() == DataTypes.ASCII )
  if ( mapEntry.key().ascii().ascii().equals("ConsumerGroup") )
    break;
  else if ( mapEntry.key().ascii().ascii().equals("NiProviderGroup") )
    break;
  else if (mapEntry.key().ascii().ascii().equals("IProviderGroup") )

代码示例来源: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

switch (mapEntry.key().dataType())
    System.out.println(mapEntry.key().buffer() + "\t" + mapEntry.mapActionAsString());
    break;
  case DataTypes.ASCII :
    System.out.println(mapEntry.key().ascii() + "\t" + mapEntry.mapActionAsString());
    break;
  case DataTypes.RMTES :
    System.out.println(mapEntry.key().rmtes() + "\t" + mapEntry.mapActionAsString());
    break;
  default:

代码示例来源:origin: Refinitiv/Elektron-SDK

switch (mapEntry.key().dataType())
  System.out.println("Action = " + mapEntry.mapActionAsString() + ", key = " + mapEntry.key().ascii());
  break;
case DataTypes.BUFFER :
  System.out.println("Action = " + mapEntry.mapActionAsString() + ", key = " + mapEntry.key().buffer());
  break;
default:

代码示例来源:origin: Refinitiv/Elektron-SDK

TestUtilities.checkResult(mapIter.hasNext());
com.thomsonreuters.ema.access.MapEntry me1 = mapIter.next();
TestUtilities.checkResult(me1.key().dataType(), DataType.DataTypes.UINT);
TestUtilities.checkResult(me1.key().uintValue(), 1);
TestUtilities.checkResult(me1.action(), MapEntry.MapAction.ADD);
TestUtilities.checkResult(me1.load().dataType(), DataType.DataTypes.FIELD_LIST);
TestUtilities.checkResult(me1.key().dataType(), DataType.DataTypes.UINT);
TestUtilities.checkResult(me1.key().uintValue(), 1);
TestUtilities.checkResult(me1.action(), MapEntry.MapAction.ADD);
TestUtilities.checkResult(me1.load().dataType(), DataType.DataTypes.FIELD_LIST);
TestUtilities.checkResult(me2.key().dataType(), DataType.DataTypes.UINT);
TestUtilities.checkResult(me2.key().uintValue(), 2);
TestUtilities.checkResult(me2.action(), MapEntry.MapAction.UPDATE);
TestUtilities.checkResult(me2.load().dataType(), DataType.DataTypes.FIELD_LIST);
TestUtilities.checkResult(me3.key().dataType(), DataType.DataTypes.UINT);
TestUtilities.checkResult(me3.key().uintValue(), 3);
TestUtilities.checkResult(me3.action(), MapEntry.MapAction.DELETE);
TestUtilities.checkResult(me3.load().dataType(), DataType.DataTypes.NO_DATA);

代码示例来源:origin: Refinitiv/Elektron-SDK

TestUtilities.checkResult( mapEntry.key().ascii().ascii().equals("Key1"), "Check the key value of the first Map entry" );
TestUtilities.checkResult( mapEntry.action() == MapEntry.MapAction.ADD, "Check the key action of the first Map entry" );

代码示例来源:origin: Refinitiv/Elektron-SDK

TestUtilities.checkResult( me1.key().dataType() == DataTypes.UTF8, "MapEntry.key().dataType() == DataTypes.UTF8" );
TestUtilities.checkResult( Arrays.equals( me1.key().utf8().buffer().array() , new String("ABC").getBytes()), "MapEntry.key().utf8().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( me2.key().dataType() == DataTypes.UTF8, "MapEntry.key().dataType() == DataTypes.UTF8" );
TestUtilities.checkResult( Arrays.equals( me2.key().utf8().buffer().array() , new String("ABC").getBytes()), "MapEntry.key().utf8().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( me3.key().dataType() == DataTypes.UTF8, "MapEntry.key().dataType() == DataTypes.UTF8" );
  TestUtilities.checkResult( Arrays.equals( me3.key().utf8().buffer().array() , new String("DEFGH").getBytes()), "MapEntry.key().utf8().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() == DataType.DataTypes.FIELD_LIST" );
TestUtilities.checkResult( me4.key().dataType() == DataTypes.UTF8, "MapEntry.key().dataType() == DataTypes.UTF8" );
TestUtilities.checkResult( Arrays.equals( me4.key().utf8().buffer().array() , new String("KLMNOPQRS").getBytes()), "MapEntry.key().utf8().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(me1.key().dataType(), DataType.DataTypes.INT);
TestUtilities.checkResult(me1.key().intValue(), 1);
TestUtilities.checkResult(me1.action(), MapEntry.MapAction.UPDATE);
TestUtilities.checkResult(me1.load().dataType(), DataType.DataTypes.FIELD_LIST);
TestUtilities.checkResult(me1.key().dataType(), DataType.DataTypes.INT);
TestUtilities.checkResult(me1.key().intValue(), 1);
TestUtilities.checkResult(me1.action(), MapEntry.MapAction.UPDATE);
TestUtilities.checkResult(me1.load().dataType(), DataType.DataTypes.FIELD_LIST);
TestUtilities.checkResult(me2.key().dataType(), DataType.DataTypes.INT);
TestUtilities.checkResult(me2.key().intValue(), 2);
TestUtilities.checkResult(me2.action(), MapEntry.MapAction.ADD);
TestUtilities.checkResult(me2.load().dataType(), DataType.DataTypes.FIELD_LIST);
TestUtilities.checkResult(me3.key().dataType(), DataType.DataTypes.INT);
TestUtilities.checkResult(me3.key().intValue(), 3);
TestUtilities.checkResult(me3.action(), MapEntry.MapAction.DELETE);
TestUtilities.checkResult(me3.load().dataType(), DataType.DataTypes.NO_DATA);

代码示例来源:origin: Refinitiv/Elektron-SDK

if (DataTypes.BUFFER != mapEntry.key().dataType())
  return;

代码示例来源:origin: Refinitiv/Elektron-SDK

private void decode(Map map)
{
  FilterList filterList;
  boolean findMapEntry = false;
  for(MapEntry mapEntry : map)
  {
      if (mapEntry.loadType() == DataTypes.FILTER_LIST)
      {
        filterList = mapEntry.filterList();
        for(FilterEntry filterEntry : filterList)
        {
            if (filterEntry.loadType() == DataTypes.ELEMENT_LIST )
            {
              if (decode(filterEntry.elementList()))
              {
                _serviceId = (int) mapEntry.key().uintValue();
                findMapEntry = true;
              }
            }
        }
      }
      
      if (findMapEntry)
        return;
  }
}

代码示例来源: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

TestUtilities.checkResult( mapEntryA.key().rmtes().asHex().equals(rmtesKey1) , "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.hasPermissionData() == false, "Check wheter the first map entry has permission data");
MapEntry mapEntryB = mapIt.next();
TestUtilities.checkResult( mapEntryB.key().rmtes().asHex().equals(rmtesKey2) , "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.permissionData().equals(permissionData) == true, "Compare the permission data of the second map entry");
MapEntry mapEntryC = mapIt.next();
TestUtilities.checkResult( mapEntryC.key().rmtes().asHex().equals(rmtesKey3) , "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");

代码示例来源:origin: Refinitiv/Elektron-SDK

void decodeMap(Map map)
{
  System.out.println("Map Summary");
  decode(map.summaryData().data());
  for (MapEntry mapEntry : map)
  {
    System.out.println("Action = " + mapEntry.mapActionAsString());
    System.out.println("Key");
    decode(mapEntry.key().data());
    System.out.println("Load");
    decode(mapEntry.load());
  }
}

代码示例来源:origin: Refinitiv/Elektron-SDK

TestUtilities.checkResult( mapEntryA.key().dateTime().toString().equals("05 APR 2021 01:02:03:004:005:006") , "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.hasPermissionData() == false, "Check wheter the first map entry has permission data");
MapEntry mapEntryB = mapIt.next();
TestUtilities.checkResult( mapEntryB.key().dateTime().toString().equals("06 MAY 2022 02:03:04:005:006:007"), "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.permissionData().equals(permissionData) == true, "Compare the permission data of the second map entry");
MapEntry mapEntryC = mapIt.next();
TestUtilities.checkResult( mapEntryC.key().dateTime().toString().equals("07 JUN 2023 03:04:05:006:007:008"), "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");

代码示例来源:origin: Refinitiv/Elektron-SDK

TestUtilities.checkResult( mapEntryA.key().date().toString().equals("02 JAN 2018") , "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.hasPermissionData() == false, "Check wheter the first map entry has permission data");
MapEntry mapEntryB = mapIt.next();
TestUtilities.checkResult( mapEntryB.key().date().toString().equals("03 FEB 2019"), "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.permissionData().equals(permissionData) == true, "Compare the permission data of the second map entry");
MapEntry mapEntryC = mapIt.next();
TestUtilities.checkResult( mapEntryC.key().date().toString().equals("04 MAR 2020"), "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");

代码示例来源:origin: Refinitiv/Elektron-SDK

com.thomsonreuters.ema.access.MapEntry mapEntry1 = mapIter.next();
checkResult(mapEntry1.action(), com.thomsonreuters.ema.access.MapEntry.MapAction.ADD);
checkResult(mapEntry1.key().dataType(), com.thomsonreuters.ema.access.DataType.DataTypes.UINT );
checkResult(mapEntry1.key().uintValue(), 1 ); 
checkResult(mapEntry1.loadType(), com.thomsonreuters.ema.access.DataType.DataTypes.FIELD_LIST);
checkResult(mapEntry1.load().dataType(), com.thomsonreuters.ema.access.DataType.DataTypes.FIELD_LIST);
com.thomsonreuters.ema.access.MapEntry mapEntry2 = mapIter.next();
checkResult(mapEntry2.action(), com.thomsonreuters.ema.access.MapEntry.MapAction.UPDATE);
checkResult(mapEntry2.key().dataType(), com.thomsonreuters.ema.access.DataType.DataTypes.UINT );
checkResult(mapEntry2.key().uintValue(), 2 ); 
checkResult(mapEntry2.loadType(), com.thomsonreuters.ema.access.DataType.DataTypes.FIELD_LIST);
checkResult(mapEntry2.load().dataType(), com.thomsonreuters.ema.access.DataType.DataTypes.FIELD_LIST);
com.thomsonreuters.ema.access.MapEntry mapEntry1 = mapIter.next();
checkResult(mapEntry1.action(), com.thomsonreuters.ema.access.MapEntry.MapAction.ADD);
checkResult(mapEntry1.key().dataType(), com.thomsonreuters.ema.access.DataType.DataTypes.UINT );
checkResult(mapEntry1.key().uintValue(), 1 ); 
checkResult(mapEntry1.loadType(), com.thomsonreuters.ema.access.DataType.DataTypes.ELEMENT_LIST);
checkResult(mapEntry1.load().dataType(), com.thomsonreuters.ema.access.DataType.DataTypes.ELEMENT_LIST);
com.thomsonreuters.ema.access.MapEntry mapEntry2 = mapIter.next();
checkResult(mapEntry2.action(), com.thomsonreuters.ema.access.MapEntry.MapAction.UPDATE);
checkResult(mapEntry2.key().dataType(), com.thomsonreuters.ema.access.DataType.DataTypes.UINT );
checkResult(mapEntry2.key().uintValue(), 2 ); 
checkResult(mapEntry2.loadType(), com.thomsonreuters.ema.access.DataType.DataTypes.ELEMENT_LIST);
checkResult(mapEntry2.load().dataType(), com.thomsonreuters.ema.access.DataType.DataTypes.ELEMENT_LIST);
com.thomsonreuters.ema.access.MapEntry mapEntry1 = mapIter.next();

代码示例来源:origin: Refinitiv/Elektron-SDK

TestUtilities.checkResult( mapEntryA.key().ascii().ascii().equals("ITEM1"), "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.hasPermissionData() == false, "Check wheter the first map entry has permission data");
MapEntry mapEntryB = mapIt.next();
TestUtilities.checkResult( mapEntryB.key().ascii().ascii().equals("ITEM2"), "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.permissionData().equals(permissionData), "Compare the permission data of the second map entry");
MapEntry mapEntryC = mapIt.next();
TestUtilities.checkResult( mapEntryC.key().ascii().ascii().equals("ITEM3"), "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");

代码示例来源:origin: Refinitiv/Elektron-SDK

void retrieveServer(Map map, String serverName,
  ActiveServerConfig activeServerConfig, int portFnCalled, ServerConfig fileCfg)
{
  for (MapEntry mapEntry : map)
  {
    if (mapEntry.key().dataType() == DataTypes.ASCII &&
        mapEntry.key().ascii().ascii().equals("ServerGroup") &&
        mapEntry.loadType() == DataTypes.ELEMENT_LIST)
    {
      for (ElementEntry elementEntry : mapEntry.elementList())
      {
        if (elementEntry.loadType() == DataTypes.MAP && elementEntry.name().equals("ServerList"))
        {
          for (MapEntry mapListEntry : elementEntry.map())
          {
            if ((mapListEntry.key().dataType() == DataTypes.ASCII) && 
                mapListEntry.key().ascii().ascii().equals(serverName) && 
                mapListEntry.loadType() == DataTypes.ELEMENT_LIST)
            {
              retrieveServerInfo(mapListEntry, serverName, activeServerConfig, portFnCalled, fileCfg);
            }
          }
        }
      }
    }
  }
}

代码示例来源: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

TestUtilities.checkResult( mapEntry.key().ascii().ascii().equals("Key1"), "Check the key value of the first Map entry" );
TestUtilities.checkResult( mapEntry.action() == MapEntry.MapAction.ADD, "Check the key action of the first Map entry" );

相关文章