當前位置: 首頁>>代碼示例>>Java>>正文


Java IdentityHashMap.keySet方法代碼示例

本文整理匯總了Java中java.util.IdentityHashMap.keySet方法的典型用法代碼示例。如果您正苦於以下問題:Java IdentityHashMap.keySet方法的具體用法?Java IdentityHashMap.keySet怎麽用?Java IdentityHashMap.keySet使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.util.IdentityHashMap的用法示例。


在下文中一共展示了IdentityHashMap.keySet方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getConstantExpressionSet

import java.util.IdentityHashMap; //導入方法依賴的package包/類
/**
 * Get a list of expressions that mark boundaries into a constant space.
 * @param e
 * @return
 */
public static Set<LogicalExpression> getConstantExpressionSet(LogicalExpression e){
  IdentityHashMap<LogicalExpression, Object> map = new IdentityHashMap<>();
  ConstantExpressionIdentifier visitor = new ConstantExpressionIdentifier();


  if(e.accept(visitor, map) && map.isEmpty()){
    // if we receive a constant value here but the map is empty, this means the entire tree is a constant.
    // note, we can't use a singleton collection here because we need an identity set.
    map.put(e, true);
    return map.keySet();
  }else if(map.isEmpty()){
    // so we don't continue to carry around a map, we let it go here and simply return an empty set.
    return Collections.emptySet();
  }else{
    return map.keySet();
  }
}
 
開發者ID:skhalifa,項目名稱:QDrill,代碼行數:23,代碼來源:ConstantExpressionIdentifier.java

示例2: getAllAtoms

import java.util.IdentityHashMap; //導入方法依賴的package包/類
/**
 * Returns a modifiable copy of the list of all i-th atom from all tuples in
 * some arbitrary order (0 is first atom, 1 is second atom...)
 * 
 * @throws - ErrorAPI if this tupleset contains at least one tuple whose
 *             length is less than or equal to i
 */
public List<SimAtom> getAllAtoms(int column) throws ErrorAPI {
	if (empty())
		return new ArrayList<SimAtom>(0);
	if (column < 0 || column >= arity())
		throw new ErrorAPI("This tupleset does not have an \"" + column + "th\" column.");
	IdentityHashMap<SimAtom,Boolean> ans = new IdentityHashMap<SimAtom,Boolean>();
	for (SimTuple x : this)
		ans.put(x.get(column), Boolean.TRUE);
	return new ArrayList<SimAtom>(ans.keySet());
}
 
開發者ID:AlloyTools,項目名稱:org.alloytools.alloy,代碼行數:18,代碼來源:SimTupleset.java

示例3: getAllAtoms

import java.util.IdentityHashMap; //導入方法依賴的package包/類
/** Returns a modifiable copy of the list of all i-th atom from all tuples in some arbitrary order (0 is first atom, 1 is second atom...)
 * @throws - ErrorAPI if this tupleset contains at least one tuple whose length is less than or equal to i
 */
public List<SimAtom> getAllAtoms(int column) throws ErrorAPI {
    if (empty()) return new ArrayList<SimAtom>(0);
    if (column<0 || column>=arity()) throw new ErrorAPI("This tupleset does not have an \""+column+"th\" column.");
    IdentityHashMap<SimAtom,Boolean> ans = new IdentityHashMap<SimAtom,Boolean>();
    for(SimTuple x: this) ans.put(x.get(column), Boolean.TRUE);
    return new ArrayList<SimAtom>(ans.keySet());
}
 
開發者ID:ModelWriter,項目名稱:Tarski,代碼行數:11,代碼來源:SimTupleset.java

示例4: SimulatorPlayerGameState

import java.util.IdentityHashMap; //導入方法依賴的package包/類
SimulatorPlayerGameState(int width, int height, int halfTurnCounter, Player[] players, int playerIndex, IdentityHashMap<Tile, Boolean> tilesToVisibility, Map<Integer, Simulator.PlayerStats> playersStats) {
    this.width = width;
    this.height = height;
    this.halfTurnCounter = halfTurnCounter;
    this.players = players;
    this.playerIndex = playerIndex;
    this.playersStats = playersStats;
    Map<Position, Field> fields = new HashMap<>();
    for (Tile tile : tilesToVisibility.keySet()) {
        Position position = Position.fromIndex(tile.getTileIndex(), width);
        Field field = tileToField(position, tile, this, tilesToVisibility.get(tile));
        fields.put(position, field);
    }
    this.fields = ImmutableMap.copyOf(fields);
}
 
開發者ID:greenjoe,項目名稱:sergeants,代碼行數:16,代碼來源:SimulatorPlayerGameState.java

示例5: getMergeSets

import java.util.IdentityHashMap; //導入方法依賴的package包/類
Collection<ArrayList<Wire>> getMergeSets() {
	IdentityHashMap<ArrayList<Wire>, Boolean> lists;
	lists = new IdentityHashMap<ArrayList<Wire>, Boolean>();
	for (ArrayList<Wire> list : map.values()) {
		lists.put(list, Boolean.TRUE);
	}
	return lists.keySet();
}
 
開發者ID:LogisimIt,項目名稱:Logisim,代碼行數:9,代碼來源:WireRepair.java


注:本文中的java.util.IdentityHashMap.keySet方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。