/** * Checks whether the specified node is occupied. * @param node The node to check for occupancy. * @return <code>true</code> if the specified node is occupied, * <code>false</code> otherwise. */ @Override public boolean isOccupied(Point node) { return occupiedNodes.containsValue(node); }
public boolean containsValue(Object value) { if(guavaMultiMap != null) return guavaMultiMap.containsValue(value); return hcMultiMap.containsValue(value); }
@Override public void addObjectAt(RoadUser newObj, Point pos) { if (newObj instanceof MovingRoadUser) { checkArgument( !occupiedNodes.containsValue(pos), "A MovingRoadUser can not be added on an already occupied position " + "%s.", pos); occupiedNodes.put((MovingRoadUser) newObj, pos); } super.addObjectAt(newObj, pos); }
public boolean isPropertyModified(final ChronoProperty<?> property) { checkNotNull(property, "Precondition violation - argument 'property' must not be NULL!"); return this.propertyNameToModifiedProperties.containsValue(IdentityWrapper.of(property)); }
protected Multimap<CaseGroupTree, CaseGroupTree> checkSwitchStatement(SwitchStatementTree node) { SetMultimap<CaseGroupTree, CaseGroupTree> identicalBranches = HashMultimap.create(); int index = 0; List<CaseGroupTree> cases = node.cases(); for (CaseGroupTree caseGroupTree : cases) { index++; if (identicalBranches.containsValue(caseGroupTree)) { continue; } for (int i = index; i < cases.size(); i++) { if (SyntacticEquivalence.areEquivalent(caseGroupTree.body(), cases.get(i).body())) { identicalBranches.put(caseGroupTree, cases.get(i)); } } } return identicalBranches; }
protected Multimap<CaseGroupTree, CaseGroupTree> checkSwitchStatement(SwitchStatementTree node) { SetMultimap<CaseGroupTree, CaseGroupTree> identicalBranches = HashMultimap.create(); int index = 0; List<CaseGroupTree> cases = node.cases(); for (CaseGroupTree caseGroupTree : cases) { index++; if (identicalBranches.containsValue(caseGroupTree)) { continue; } for (int i = index; i < cases.size(); i++) { if (SyntacticEquivalence.areEquivalent(caseGroupTree.body(), cases.get(i).body())) { identicalBranches.put(caseGroupTree, cases.get(i)); } } } return identicalBranches; }
final double relPos = registry().getRelativePosition(object); if (relPos < vehicleLength + minDistance) { verify(!occupiedNodes.containsValue(conn.from())); verify(occupiedNodes.put(object, conn.from())); if (occupiedNodes.containsValue(conn.to()) && distToTo > 0 && distToTo < DELTA) { verify(!occupiedNodes.containsValue(conn.to())); verify(occupiedNodes.put(object, conn.to())); verify(!occupiedNodes.containsValue(loc)); verify(occupiedNodes.put(object, loc));
final Connection<?> conn = getConnection(from, to); if (occupiedNodes.containsValue(conn.to())) { closestDist = (registry().isOnConnection(from) ? registry().getConnection(from).getLength()