List of usage examples for java.util Collections unmodifiableCollection
public static <T> Collection<T> unmodifiableCollection(Collection<? extends T> c)
From source file:me.st28.flexseries.flexchat.api.channel.Channel.java
public Collection<ChatFormat> getChatFormats() { return Collections.unmodifiableCollection(formats.values()); }
From source file:edu.uci.ics.jung.graph.DirectedSparseMultigraph.java
public Collection<V> getPredecessors(V vertex) { if (!containsVertex(vertex)) return null; Set<V> preds = new HashSet<V>(); for (E edge : getIncoming_internal(vertex)) preds.add(this.getSource(edge)); return Collections.unmodifiableCollection(preds); }
From source file:com.hp.autonomy.aci.content.identifier.reference.ReferencesBuilder.java
@Override public Iterator<Reference> iterator() { // We may later decide to make ReferencesBuilder a full Collection but for now we need to avoid allowing removal // via Iterator, so wrap our collection return Collections.unmodifiableCollection(references).iterator(); }
From source file:fr.gael.dhus.olingo.v1.map.AbstractFunctionalMap.java
@Override public Collection<V> values() { return Collections.unmodifiableCollection(sourceMap.values()); }
From source file:edu.uci.ics.jung.graph.DirectedSparseGraph.java
public Collection<V> getSuccessors(V vertex) { if (!containsVertex(vertex)) return null; return Collections.unmodifiableCollection(getSuccs_internal(vertex)); }
From source file:io.coala.example.conway.CellWorldLattice.java
/** * {@link CellWorldLattice} constructor//w w w. j a v a 2 s . c o m * * @param host * @throws CoalaException */ @Inject public CellWorldLattice(final Binder binder) throws CoalaException { super(binder); final SimTimeFactory simTimeFactory = getBinder().inject(SimTimeFactory.class); final SimTime startCycle = simTimeFactory.create(0, TimeUnit.TICKS); this.cycleDuration = simTimeFactory.create(getProperty("cycleDuration").getNumber(), TimeUnit.TICKS); // this lattice has fixed neighbor links final List<Map<CellID, LifeState>> initialStates = getInitialStates(); final Collection<CellLinkPercept> neighborPercepts = new ArrayList<CellLinkPercept>(); this.neighborPercepts = Collections.unmodifiableCollection(neighborPercepts); this.transitions.subscribe(GLOBAL_TRANSITIONS); if (getID().getOwnerID() instanceof CellID) { final CellID myID = (CellID) getID().getOwnerID(); final LifeState startState = getInitialStates().get(myID.getRow()).get(myID); for (CellID cellID : getNeighborIDs(myID, initialStates.size(), initialStates.get(0).size())) neighborPercepts.add(new CellLinkPerceptImpl(cellID, CellLinkPerceptType.CONNECTED)); final CellStateTransition initialTransition = new CellStateTransition(null, new CellState(startCycle, myID, startState)); this.transitions.onNext(initialTransition); System.err.println("Initial transition: " + initialTransition); } }
From source file:org.a3badran.platform.logging.RequestLogger.java
public static Collection<Writer> getWriters() { return Collections.unmodifiableCollection(RequestLogger.writers); }
From source file:net.minecraftforge.fml.common.registry.VillagerRegistry.java
/** * Returns a list of all added villager types * * @return newVillagerIds//from w w w. j a va2s .c om */ @Deprecated // Doesn't work at all. public static Collection<Integer> getRegisteredVillagers() { return Collections.unmodifiableCollection(instance().newVillagerIds); }
From source file:com.phoenixst.plexus.util.UnmodifiableGraph.java
public Collection adjacentNodes(Object node, Predicate traverserPredicate) { return Collections.unmodifiableCollection(delegate.adjacentNodes(node, traverserPredicate)); }
From source file:fr.gouv.culture.thesaurus.service.rdf.Concept.java
/** * @return the topAncestors */ public Collection<Concept> getTopAncestors() { return Collections.unmodifiableCollection(this.topAncestors); }