本文整理汇总了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();
}
}
示例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());
}
示例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());
}
示例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);
}
示例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();
}