/** * Decorates the specified map to add the MultiKeyMap API and fast query. * The map must not be null and must be empty. * * @param <K> the key type * @param <V> the value type * @param map the map to decorate, not null * @return a new multi key map * @throws NullPointerException if map is null * @throws IllegalArgumentException if the map is not empty * @since 4.0 */ public static <K, V> MultiKeyMap<K, V> multiKeyMap(final AbstractHashedMap<MultiKey<? extends K>, V> map) { if (map == null) { throw new NullPointerException("Map must not be null"); } if (map.size() > 0) { throw new IllegalArgumentException("Map must be empty"); } return new MultiKeyMap<>(map); }
public LocalScoreCache() { map = new MultiKeyMap(); }
Map reversedMap = new MultiKeyMap();
/** * Collect blog entry statistics information from a planet archive. */ private void doTraverseFeedEntries(Node rssParent) throws RepositoryException { Date startDate = getStatisticsStartDate(); log.info("Statistics will be build on content with date " + startDate + " or later."); if (rssParent != null) { NodeIterator feeds = rssParent.getNodes(); while (feeds.hasNext()) { Node feedNode = feeds.nextNode(); if (NodeUtil.isNodeType(feedNode, RSSAggregatorNodeTypes.RSSAggregator.NAME) && PlanetUtil.isPlanetNode(feedNode)) { log.info("Creating statistics for planet feed: " + feedNode.getName()); MultiKeyMap<String, List<Node>> entryMap = new MultiKeyMap<>(); String sql2 = "select * from [mgnl:content] as t where ISDESCENDANTNODE([" + feedNode.getPath() + "/" + FEED_DATA_NAME + "]) and t.rssLink IS NOT NULL AND t.author IS NOT NULL ORDER BY t.author, t.rssLink"; NodeIterator entries = QueryUtil.search(RSSAggregatorConstants.WORKSPACE, sql2); while (entries.hasNext()) { Node entry = entries.nextNode(); createMapEntry(entryMap, entry); } createStatisticsNodes(entryMap, feedNode); } } } else { log.info("Could not find parent node for data/rssaggregator feed entries."); } }
LegalPairs legalPairs, List<Node> c, List<Node> d, Graph graph, int maxPathLength) { HashSet<Node> reachable = new HashSet<>(); MultiKeyMap visited = new MultiKeyMap(); List<ReachabilityEdge> nextEdges = new LinkedList<>();