java.util.AbstractMap.get()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(123)

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

AbstractMap.get介绍

[英]This implementation iterates its entry set, looking for an entry with a key that key equals.
[中]此实现迭代其条目集,查找具有key等于的key的条目。

代码示例

代码示例来源:origin: jenkinsci/jenkins

@Override
public R get(Object key) {
  if (key instanceof Integer) {
    int n = (Integer) key;
    return get(n);
  }
  return super.get(key);
}

代码示例来源:origin: peter-lawrey/Java-Chronicle

@Override
public String get(Object key) {
  for (String s : scopeArray) {
    String key2 = s + key;
    Object obj = properties.get(key2);
    if (obj == null)
      continue;
    return String.valueOf(obj);
  }
  return super.get(String.valueOf(key));
}

代码示例来源:origin: haraldk/TwelveMonkeys

public Object get(final Object pKey) {
  return super.get(pKey);
}

代码示例来源:origin: org.apache.hadoop/hadoop-hdfs

/**
 * Iterate through all the elements we're tracking and, if a value was
 * recorded for it, write it out.
 */
private void writeLine() throws IOException {
 Iterator<ImageElement> it = elementsToTrack.iterator();
 
 while(it.hasNext()) {
  ImageElement e = it.next();
  
  String v = null;
  if(e == ImageElement.NUM_BYTES)
   v = String.valueOf(fileSize);
  else
   v = elements.get(e);
  
  if(v != null)
   write(v);
  
  if(it.hasNext())
   write(delimiter);
 }
}

代码示例来源:origin: com.github.stephenc.scale7/scale7-core

/**
 * Get the node in the cluster by its id. The id of a node is returned by its <code>toString()</code> method.
 * @param nodeId The id of the node in the cluster
 * @return The cluster node with the specified id. <code>null</code> is returned if the node is not present 
 */
public T getNodeById(String nodeId) {
  AbstractMap<String, T> currNodeMap = nodeMap;
  return currNodeMap.get(nodeId);
}

代码示例来源:origin: com.github.lafa.twelvemonkeyspurejava.common/common-lang

public Object get(final Object pKey) {
  return super.get(pKey);
}

代码示例来源:origin: com.twelvemonkeys.common/common-lang

public Object get(final Object pKey) {
  return super.get(pKey);
}

代码示例来源:origin: com.twelvemonkeys/twelvemonkeys-core

public Object get(final Object pKey) {
  return super.get(pKey);
}

代码示例来源:origin: com.tunnelvisionlabs/runtime-testsuite

@Override
public Object get(Object key) {
  if (key instanceof String) {
    String str = (String)key;
    return str.length();
  }
  return super.get(key);
}

代码示例来源:origin: com.higherfrequencytrading/chronicle

@Override
public String get(Object key) {
  for (String s : scopeArray) {
    String key2 = s + key;
    Object obj = properties.get(key2);
    if (obj == null)
      continue;
    return String.valueOf(obj);
  }
  return super.get(String.valueOf(key));
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

@Override
public R get(Object key) {
  if (key instanceof Integer) {
    int n = (Integer) key;
    return get(n);
  }
  return super.get(key);
}

代码示例来源:origin: ConsenSys/eventeum

/**
 * {@inheritDoc}
 */
@Override
public void updateLatestBlock(String eventSpecHash, BigInteger blockNumber) {
  final BigInteger currentLatest = latestBlocks.get(eventSpecHash);
  if (currentLatest == null || blockNumber.compareTo(currentLatest) > 0) {
    latestBlocks.put(eventSpecHash, blockNumber);
  }
}

代码示例来源:origin: org.apache.velocity/velocity-engine-core

@Override
public Object get(Object key)
{
  Object o = super.get(key);
  if (o == null && parent != null && !containsKey(key))
  {
    return parent.get(key);
  }
  return o;
}

代码示例来源:origin: com.bbossgroups/bboss-velocity

public Object get(Object key)
{
  Object o = super.get(key);
  if (o == null && parent != null && !containsKey(key))
  {
    return parent.get(key);
  }
  return o;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.velocity

public Object get(Object key)
{
  Object o = super.get(key);
  if (o == null && parent != null && !containsKey(key))
  {
    return parent.get(key);
  }
  return o;
}

代码示例来源:origin: edu.illinois.cs.cogcomp/LBJava

/**
 * Replaces all unquantified variables with the unique copy stored as a value of the given map;
 * also instantiates all quantified variables and stores them in the given map.
 *
 * @param m The map in which to find unique copies of the variables.
 **/
public void consolidateVariables(java.util.AbstractMap m) {
  variableMap = m;
  if (m.containsKey(left))
    left = (FirstOrderVariable) m.get(left);
  else
    m.put(left, left);
}

代码示例来源:origin: edu.illinois.cs.cogcomp/LBJava

/**
 * Replaces all unquantified variables with the unique copy stored as a value of the given map;
 * also instantiates all quantified variables and stores them in the given map.
 *
 * @param m The map in which to find unique copies of the variables.
 **/
public void consolidateVariables(java.util.AbstractMap m) {
  variableMap = m;
  if (m.containsKey(left))
    left = (FirstOrderVariable) m.get(left);
  else
    m.put(left, left);
  if (m.containsKey(right))
    right = (FirstOrderVariable) m.get(right);
  else
    m.put(right, right);
}

代码示例来源:origin: edu.illinois.cs.cogcomp/LBJava

/**
 * Replaces all unquantified variables with the unique copy stored as a value of the given map;
 * also instantiates all quantified variables and stores them in the given map.
 *
 * @param m The map in which to find unique copies of the variables.
 **/
public void consolidateVariables(java.util.AbstractMap m) {
  if (constraint instanceof PropositionalVariable) {
    if (m.containsKey(constraint))
      constraint = (PropositionalVariable) m.get(constraint);
    else
      m.put(constraint, constraint);
  } else
    constraint.consolidateVariables(m);
}

代码示例来源:origin: it.unibo.alice.tuprolog/tuprolog

@Override //Alberto 
public Term copyAndRetainFreeVar(AbstractMap<Var,Var> vMap, int idExecCtx) {
  Term tt = getTerm();
  if (tt == this) {
    Var v = (vMap.get(this));
    if (v == null) {
      //No occurence of v before
      v = this; //!!!
      vMap.put(this,v);
    }
    return v;
  } else {
    return tt.copy(vMap, idExecCtx);
  }
}

代码示例来源:origin: ConsenSys/eventeum

/**
   * {@inheritDoc}
   */
  @Override
  public BigInteger getLatestBlockForEvent(ContractEventSpecification eventSpec) {
    final String eventSignature = Web3jUtil.getSignature(eventSpec);
    final BigInteger latestBlockNumber = latestBlocks.get(eventSignature);

    if (latestBlockNumber != null) {
      return latestBlockNumber;
    }

    final ContractEventDetails contractEvent = eventStoreService.getLatestContractEvent(eventSignature);

    if (contractEvent != null) {
      return contractEvent.getBlockNumber();
    }

    return blockchainService.getCurrentBlockNumber();
  }
}

相关文章