当前位置: 首页>>代码示例>>Java>>正文


Java LinkedTreeMap.containsKey方法代码示例

本文整理汇总了Java中com.google.gson.internal.LinkedTreeMap.containsKey方法的典型用法代码示例。如果您正苦于以下问题:Java LinkedTreeMap.containsKey方法的具体用法?Java LinkedTreeMap.containsKey怎么用?Java LinkedTreeMap.containsKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.gson.internal.LinkedTreeMap的用法示例。


在下文中一共展示了LinkedTreeMap.containsKey方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getRemoteBranches

import com.google.gson.internal.LinkedTreeMap; //导入方法依赖的package包/类
static public Set<String> getRemoteBranches() {
  Set<String> possibleBranches = new HashSet<String>();
  try {
    // TODO - all http gets use HttpClient static methods and promise
    // for asynchronous
    // get gitHub's branches
    byte[] r = Http.get(GitHub.BRANCHES);
    if (r != null) {
      String branches = new String(r);
      CodecJson decoder = new CodecJson();
      // decoder.decodeArray(Branch)
      Object[] array = decoder.decodeArray(branches);
      for (int i = 0; i < array.length; ++i) {
        @SuppressWarnings("unchecked")
        LinkedTreeMap<String, String> m = (LinkedTreeMap<String, String>) array[i];
        if (m.containsKey("name")) {
          possibleBranches.add(m.get("name").toString());
        }
      }
    }
  } catch (Exception e) {
    log.error("getRemoteBranches threw", e);
  }
  return possibleBranches;
}
 
开发者ID:MyRobotLab,项目名称:myrobotlab,代码行数:26,代码来源:Agent.java

示例2: getValueDate

import com.google.gson.internal.LinkedTreeMap; //导入方法依赖的package包/类
public static  ZonedDateTime getValueDate(LinkedTreeMap value){
    try {
        String type = getPRType(value);
        LinkedTreeMap pr = (LinkedTreeMap) value.get(type);
        if(pr.containsKey("created_on")){
            return ZonedDateTime.parse(pr.get("created_on").toString());
        }else{
            return ZonedDateTime.parse(pr.get("date").toString());
        }

    }catch (Exception e){
        //Gotcha!
        return null;
    }
}
 
开发者ID:mgustavocoder,项目名称:hard-worker-activity-stream,代码行数:16,代码来源:PullRequestActivity.java

示例3: readConfigFromFile

import com.google.gson.internal.LinkedTreeMap; //导入方法依赖的package包/类
public void readConfigFromFile(){
		// Get from Environment variable		
		String filePath = Monitor.CONFIG_FILE;
		String dataConfig = "";
        try {
            try(BufferedReader br = new BufferedReader(new FileReader(filePath))) {
                StringBuilder sb = new StringBuilder();
                String line = br.readLine();

                while (line != null) {
                    sb.append(line);
                    sb.append(System.lineSeparator());
                    line = br.readLine();
                }
                dataConfig = sb.toString();
            }
        } catch (IOException e) {
        	e.printStackTrace();
        }
        if(!dataConfig.equals("")){
        	Gson gson = new Gson();
            ArrayList<LinkedTreeMap> object = (ArrayList<LinkedTreeMap>) gson.fromJson(dataConfig, Object.class);
            for (LinkedTreeMap data : object){
            	String clusterId = (String) data.get("cluster_id");
//            	ipeId += '_'+generateString(new Random(),"0123456789", 5);
                ArrayList<LinkedTreeMap> listSensor = (ArrayList<LinkedTreeMap>)data.get("sensor_list");
                for (LinkedTreeMap sensor : listSensor) {        
                	if(sensor != null){
                		if(sensor.containsKey("sensor_type")){
                			Double sensor_type = new Double((double)sensor.get("sensor_type"));
                			Double quantity = new Double((double)sensor.get("quantity"));
                			Double response_time = new Double((double)sensor.get("response_time"));                			
                			createListSensor(sensor_type.intValue(), quantity.intValue(), response_time.intValue(), clusterId);                		
                    	}
                	}        	        	
        		}

            }
        }
	}
 
开发者ID:HPCC-Cloud-Computing,项目名称:IoT,代码行数:41,代码来源:Monitor.java

示例4: readConfigFromFile

import com.google.gson.internal.LinkedTreeMap; //导入方法依赖的package包/类
public void readConfigFromFile(){			
	// Get from Environment variable
	
	String filePath = BackupMonitor.SENSOR_CONFIG;
	String dataConfig = "";
       try {
           try(BufferedReader br = new BufferedReader(new FileReader(filePath))) {
               StringBuilder sb = new StringBuilder();
               String line = br.readLine();

               while (line != null) {
                   sb.append(line);
                   sb.append(System.lineSeparator());
                   line = br.readLine();
               }
               dataConfig = sb.toString();
           }
       } catch (IOException e) {
       	e.printStackTrace();
       }
       if(!dataConfig.equals("")){
       	Gson gson = new Gson();
           ArrayList<LinkedTreeMap> object = (ArrayList<LinkedTreeMap>) gson.fromJson(dataConfig, Object.class);
           for (LinkedTreeMap data : object){
           	String clusterId = (String) data.get("cluster_id");
               ArrayList<LinkedTreeMap> listSensor = (ArrayList<LinkedTreeMap>)data.get("sensor_list");
               for (LinkedTreeMap sensor : listSensor) {        
               	if(sensor != null){
               		if(sensor.containsKey("sensor_type")){
               			Double sensor_type = new Double((double)sensor.get("sensor_type"));
               			Double quantity = new Double((double)sensor.get("quantity"));
               			Double response_time = new Double((double)sensor.get("response_time"));                			
               			createListSensor(sensor_type.intValue(), quantity.intValue(), response_time.intValue(), clusterId);                		
                   	}
               	}        	        	
       		}

           }
       }
}
 
开发者ID:HPCC-Cloud-Computing,项目名称:IoT,代码行数:41,代码来源:BackupMonitor.java

示例5: buildDescriptor

import com.google.gson.internal.LinkedTreeMap; //导入方法依赖的package包/类
private TextureDescriptor<Texture> buildDescriptor(LinkedTreeMap map) {
    TextureDescriptor<Texture> desc = new TextureDescriptor<>();
    if(map.containsKey("textureRef")) desc.texture = Argent.content.get(map.get("textureRef").toString(), Texture.class);
    if(map.containsKey("minFilter"))  desc.minFilter = Texture.TextureFilter.valueOf(map.get("minFilter").toString());
    if(map.containsKey("magFilter"))  desc.magFilter = Texture.TextureFilter.valueOf(map.get("magFilter").toString());
    if(map.containsKey("uWrap"))      desc.uWrap = Texture.TextureWrap.valueOf(map.get("uWrap").toString());
    if(map.containsKey("vWrap"))      desc.vWrap = Texture.TextureWrap.valueOf(map.get("vWrap").toString());
    return desc;
}
 
开发者ID:ncguy2,项目名称:Argent,代码行数:10,代码来源:MaterialTypeAdapter.java

示例6: buildColour

import com.google.gson.internal.LinkedTreeMap; //导入方法依赖的package包/类
private Color buildColour(LinkedTreeMap map) {
    Color col = new Color();
    if(map.containsKey("r")) col.r = ((Double)map.get("r")).floatValue();
    if(map.containsKey("g")) col.g = ((Double)map.get("g")).floatValue();
    if(map.containsKey("b")) col.b = ((Double)map.get("b")).floatValue();
    if(map.containsKey("a")) col.a = ((Double)map.get("a")).floatValue();
    return col;
}
 
开发者ID:ncguy2,项目名称:Argent,代码行数:9,代码来源:MaterialTypeAdapter.java


注:本文中的com.google.gson.internal.LinkedTreeMap.containsKey方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。