List of usage examples for java.util Collection addAll
boolean addAll(Collection<? extends E> c);
From source file:cl.ucn.disc.zoome.zui.layout.OrderedSparseGraph.java
public Collection<E> getInEdges(V vertex) { if (!containsVertex(vertex)) return null; // combine directed inedges and undirected Collection<E> in = new HashSet<E>(vertex_maps.get(vertex)[INCOMING].values()); in.addAll(vertex_maps.get(vertex)[INCIDENT].values()); return Collections.unmodifiableCollection(in); }
From source file:cl.ucn.disc.zoome.zui.layout.OrderedSparseGraph.java
public Collection<E> getOutEdges(V vertex) { if (!containsVertex(vertex)) return null; // combine directed outedges and undirected Collection<E> out = new HashSet<E>(vertex_maps.get(vertex)[OUTGOING].values()); out.addAll(vertex_maps.get(vertex)[INCIDENT].values()); return Collections.unmodifiableCollection(out); }
From source file:net.ontopia.topicmaps.query.parser.OrClause.java
@Override public Collection getAllLiterals() { Collection literals = new HashSet(); for (int ix = 0; ix < alternatives.size(); ix++) { List subclauses = (List) alternatives.get(ix); for (int i = 0; i < subclauses.size(); i++) { AbstractClause clause = (AbstractClause) subclauses.get(i); literals.addAll(clause.getAllLiterals()); }// w ww . j a v a 2 s . c o m } return literals; }
From source file:cl.ucn.disc.zoome.zui.layout.OrderedSparseGraph.java
public Collection<V> getPredecessors(V vertex) { if (!containsVertex(vertex)) return null; // consider directed inedges and undirected Collection<V> preds = new HashSet<V>(vertex_maps.get(vertex)[INCOMING].keySet()); preds.addAll(vertex_maps.get(vertex)[INCIDENT].keySet()); return Collections.unmodifiableCollection(preds); }
From source file:cl.ucn.disc.zoome.zui.layout.OrderedSparseGraph.java
public Collection<V> getSuccessors(V vertex) { if (!containsVertex(vertex)) return null; // consider directed outedges and undirected Collection<V> succs = new HashSet<V>(vertex_maps.get(vertex)[OUTGOING].keySet()); succs.addAll(vertex_maps.get(vertex)[INCIDENT].keySet()); return Collections.unmodifiableCollection(succs); }
From source file:com.netxforge.oss2.config.ThresholdingConfigFactory.java
/** * Retrieves a Collection object consisting of all the * org.opennms.netmgt.config.Threshold objects which make up the specified * thresholding group./*from ww w . ja v a 2s . c o m*/ * * @param groupName * Group name to lookup * @return Collection consisting of all the Threshold objects for the * specified group.. * @throws java.lang.IllegalArgumentException * if group name does not exist in the group map. */ public Collection<Basethresholddef> getThresholds(String groupName) { Group group = getGroup(groupName); Collection<Basethresholddef> result = new ArrayList<Basethresholddef>(); result.addAll(group.getThresholdCollection()); result.addAll(group.getExpressionCollection()); return result; }
From source file:cl.ucn.disc.zoome.zui.layout.OrderedSparseGraph.java
public Collection<E> getIncidentEdges(V vertex) { if (!containsVertex(vertex)) return null; Collection<E> incident = new HashSet<E>(vertex_maps.get(vertex)[INCOMING].values()); incident.addAll(vertex_maps.get(vertex)[OUTGOING].values()); incident.addAll(vertex_maps.get(vertex)[INCIDENT].values()); return Collections.unmodifiableCollection(incident); }
From source file:com.codecrate.shard.transfer.pcgen.PcgenDatasetImporter.java
private Collection<File> findDatasets(File root) { if (isDataset(root)) { return Collections.singleton(root); }/*from w w w . jav a 2 s . co m*/ Collection<File> results = new TreeSet<File>(); File[] files = root.listFiles(); if (null != files) { for (int i = 0; i < files.length; i++) { File child = files[i]; if (child.isDirectory()) { results.addAll(findDatasets(child)); } } } return results; }
From source file:cl.ucn.disc.zoome.zui.layout.OrderedSparseGraph.java
public Collection<V> getNeighbors(V vertex) { if (!containsVertex(vertex)) return null; // consider directed edges and undirected edges Collection<V> neighbors = new HashSet<V>(vertex_maps.get(vertex)[INCOMING].keySet()); neighbors.addAll(vertex_maps.get(vertex)[OUTGOING].keySet()); neighbors.addAll(vertex_maps.get(vertex)[INCIDENT].keySet()); return Collections.unmodifiableCollection(neighbors); }
From source file:com.precioustech.fxtrading.oanda.restapi.order.OandaOrderManagementProvider.java
@Override public Collection<Order<String, Long>> pendingOrdersForInstrument(TradeableInstrument<String> instrument) { Collection<Account<Long>> accounts = this.accountDataProvider.getLatestAccountInfo(); Collection<Order<String, Long>> allOrders = Lists.newArrayList(); for (Account<Long> account : accounts) { allOrders.addAll(this.pendingOrdersForAccount(account.getAccountId(), instrument)); }/*from w w w.j a v a 2 s . c o m*/ return allOrders; }