public void addedAttribute( final String nodeText, final String attributeText ) { addedAttrText.put( nodeText, attributeText ); }
public void removedAttribute( final String nodeText, final String attributeText ) { removedAttrText.put( nodeText, attributeText ); }
@Override public synchronized void addGroundRule(GroundRule groundRule) { groundRules.put(groundRule.getRule(), groundRule); }
private SetValuedMap<QName, QName> computeAliases() { SetValuedMap<QName, QName> rv = new HashSetValuedHashMap<>(); for (Map.Entry<QName, RelationDefinitionType> entry : relationDefinitionsByRelationName.entrySet()) { rv.put(entry.getValue().getRef(), entry.getKey()); } return rv; }
private SetValuedMap<QName, RelationKindType> computeKindsByRelationName() { SetValuedMap<QName, RelationKindType> rv = new HashSetValuedHashMap<>(); for (Map.Entry<QName, RelationDefinitionType> entry : relationDefinitionsByRelationName.entrySet()) { for (RelationKindType kind : entry.getValue().getKind()) { rv.put(entry.getKey(), kind); } } return rv; }
@Override public synchronized void addGroundRule(GroundRule groundRule) { super.addGroundRule(groundRule); // Register the ground rule with the atoms involved. for (GroundAtom atom : groundRule.getAtoms()) { atomMapping.put(atom, groundRule); } }
private void addDirectory(File directory) throws IOException { if (!directory.isDirectory()) { throw new IllegalStateException("Not a directory: " + directory); } File[] files = directory.listFiles(); if (files == null) { throw new IllegalStateException("No files found in " + directory); } for (File file : files) { if (file.isDirectory()) { addDirectory(file); } else if (file.getName().endsWith(".jar")) { try { addResource0(file.toURI().toURL()); } catch (IOException e) { throw new IllegalStateException(e); } } else { try { String relativeName = directory.toURI().relativize(file.toURI()).getPath(); FileInputStream fileInputStream = new FileInputStream(file); addClassIfClass(fileInputStream, relativeName); resources.put(relativeName, file.toURI().toURL()); fileInputStream.close(); } catch (MalformedURLException | FileNotFoundException e) { throw new IllegalStateException(e); } } } }
private void addDirectory(File directory) throws IOException { if (!directory.isDirectory()) { throw new IllegalStateException("Not a directory: " + directory); } File[] files = directory.listFiles(); if (files == null) { throw new IllegalStateException("No files found in " + directory); } for (File file : files) { if (file.isDirectory()) { addDirectory(file); } else if (file.getName().endsWith(".jar")) { try { addResource0(file.toURI().toURL()); } catch (IOException e) { throw new IllegalStateException(e); } } else { try { String relativeName = directory.toURI().relativize(file.toURI()).getPath(); FileInputStream fileInputStream = new FileInputStream(file); addClassIfClass(fileInputStream, relativeName); resources.put(relativeName, file.toURI().toURL()); fileInputStream.close(); } catch (MalformedURLException | FileNotFoundException e) { throw new IllegalStateException(e); } } } }
for (VariableElement var : eel.getParameters()) { String fullType = var.asType().toString(); mm.put(Utils.shortenJavaType(fullType), fullType);
resources.put(jarEntry.getName(), contentUrl); addClassIfClass(jarInputStream, jarEntry.getName()); if (logger != null) logger.trace("Added resource " + jarEntry.getName() + " to ClassLoader");
@Override public void deal() { int numberOfCardsPerPlayer = this.getNumberOfCardsPerPlayer(this.numberOfPlayers); for (int i = 0; i < numberOfCardsPerPlayer; i++) { for (int j = 1; j <= this.numberOfPlayers; j++) { this.cardsPerPlayer.put(j, this.deck.dealOneCard(this.shuffledCards)); } } LOGGER.info("Here are the cards which each player has:"); this.logCardsPerPlayer(); }
resources.put(jarEntry.getName(), contentUrl); addClassIfClass(jarInputStream, jarEntry.getName()); logger.trace("Added resource " + jarEntry.getName() + " to ClassLoader");
private SetValuedMap<RelationKindType, QName> computeRelationsByKind() { SetValuedMap<RelationKindType, QName> rv = new HashSetValuedHashMap<>(); for (RelationDefinitionType definition : definitions) { for (RelationKindType kind : definition.getKind()) { rv.put(kind, definition.getRef()); } } return rv; }
public ApacheCommonsDeckOfCards() { this.cards = SetUtils.unmodifiableSortedSet( Card.streamCards().collect(Collectors.toCollection(TreeSet::new))); SetValuedMap<Suit, Card> cbs = MultiMapUtils.newSetValuedHashMap(); this.cards.forEach(card -> cbs.put(card.getSuit(), card)); this.cardsBySuit = MultiMapUtils.unmodifiableMultiValuedMap(cbs); }
@Benchmark public int groupByApache(Deck deck) { SetValuedMap<Suit, Card> cbs = MultiMapUtils.newSetValuedHashMap(); deck.apacheCommonsDeckOfCards.getCards().forEach(card -> cbs.put(card.getSuit(), card)); return cbs.size(); }
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; }