当前位置: 首页>>代码示例>>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;未经允许,请勿转载。