@Override public Set<String> getAddedAttributesForNode( final String nodeText ) { return addedAttrText.get( nodeText ); }
@Override public Iterable<GroundRule> getGroundRules(Rule rule) { return groundRules.get(rule); }
@Override public Set<String> getRemovedAttributesForNode( final String nodeText ) { return removedAttrText.get( nodeText ); }
Set<URL> findLocalResources(String name) { return resources.get(name); }
Set<URL> findLocalResources(String name) { return resources.get(name); }
boolean isOfKind(QName relation, RelationKindType kind) { Set<RelationKindType> relationKinds = kindsByRelationName.get(relation); return relationKinds != null && relationKinds.contains(kind); }
@Override public int count(Rule rule) { return groundRules.get(rule).size(); }
private void addDefaultRelationToMaps() { QName defaultRelation = defaultRelationByKind.get(RelationKindType.MEMBER); if (defaultRelation != null) { relationDefinitionsByRelationName.put(null, relationDefinitionsByRelationName.get(defaultRelation)); kindsByRelationName.putAll(null, kindsByRelationName.get(defaultRelation)); } }
@NotNull Collection<QName> getAliases(QName relation) { Set<QName> aliases = this.aliases.get(normalizeRelation(relation)); if (!CollectionUtils.isEmpty(aliases)) { return aliases; } else { // for unknown relations we would like to return at least the provided name return singleton(relation); } } //endregion
public Set<GroundRule> getRegisteredGroundRules(GroundAtom atom) { if (!atomMapping.containsKey(atom)) { return Collections.emptySet(); } return Collections.unmodifiableSet(atomMapping.get(atom)); }
private void logCardCountPerPlayer() { for (int player : this.cardsPerPlayer.keySet()) { Set<Card> cards = this.cardsPerPlayer.get(player); LOGGER.info("Player:{} has {} cards", player, cards.size()); } }
@NotNull Collection<QName> getAllRelationsFor(RelationKindType kind) { return emptyIfNull(relationsByKind.get(kind)); }
private void logCardsPerPlayer() { for (int player : this.cardsPerPlayer.keySet()) { Set<Card> cards = this.cardsPerPlayer.get(player); LOGGER.info("Player:{}, cards:{}", player, cards.toString()); } } }
if (logger != null) logger.trace( "Already have resource " + jarEntry.getName() + ". If different versions, unexpected behaviour " + "might occur. Available in " + resources.get(jarEntry.getName()));
String fullType = var.asType().toString(); final String shortType = Utils.shortenJavaType(fullType); if (mm.get(shortType).size() > 1) { sb.append(fullType); } else {
private boolean checkIfPlayerWins(int playerNumber) { Bag<Rank> newRanks = this.getRanks(this.cardsPerPlayer.get(playerNumber)); Rank rank = this.getProbableBook(newRanks); int rankCount = newRanks.getCount(rank); if (rankCount == 4) { LOGGER.info("Player:{} has a BOOK! Player:{} WINS!!!", playerNumber, playerNumber); this.outcome = Outcome.WINNER; return false; } this.outcome = Outcome.CONTINUE; return true; }
logger.trace( "Already have resource " + jarEntry.getName() + ". If different versions, unexpected behaviour " + "might occur. Available in " + resources.get(jarEntry.getName()));
private Map<RelationKindType, QName> computeDefaultRelationByKind() { Map<RelationKindType, QName> rv = new HashMap<>(); for (RelationKindType kind : RelationKindType.values()) { Set<QName> relationNames = relationsByKind.get(kind); if (relationNames.isEmpty()) { LOGGER.warn("No relations defined for kind {}, please define at least one", kind);
private List<AccessCertificationResponseType> getOutcomesFromCompletedStages(AccessCertificationCaseType aCase, Integer additionalStageNumber, AccessCertificationResponseType additionalStageResponse) { LOGGER.trace("getOutcomesFromCompletedStages: additionalStageNumber={}, additionalStageResponse={}", additionalStageNumber, additionalStageResponse); SetValuedMap<Integer, AccessCertificationResponseType> allOutcomes = new HashSetValuedHashMap<>(); for (CaseEventType event : aCase.getEvent()) { if (event instanceof StageCompletionEventType) { StageCompletionEventType stageCompletionEvent = (StageCompletionEventType) event; if (event.getStageNumber() == null) { throw new IllegalStateException("Missing stage number in StageCompletionEventType: " + event); } allOutcomes.put(event.getStageNumber(), normalizeToNonNull(fromUri(stageCompletionEvent.getOutcome()))); } } if (additionalStageNumber != null) { allOutcomes.put(additionalStageNumber, normalizeToNonNull(additionalStageResponse)); } List<AccessCertificationResponseType> rv = new ArrayList<>(); for (Integer stage : allOutcomes.keySet()) { Set<AccessCertificationResponseType> stageOutcomes = allOutcomes.get(stage); addIgnoreNull(rv, extractStageOutcome(stageOutcomes, aCase.getId(), stage)); } return rv; }