/** * Gets an unmodifiable view as a Set. * * @return an unmodifiable set view */ public Set asSet() { return UnmodifiableSet.decorate(set); }
/** * Factory method to create an unmodifiable set. * * @param set the set to decorate, must not be null * @throws IllegalArgumentException if set is null */ public static Set decorate(Set set) { if (set instanceof Unmodifiable) { return set; } return new UnmodifiableSet(set); }
public Iterator iterator() { return UnmodifiableIterator.decorate(getCollection().iterator()); }
/** * Returns an unmodifiable set backed by the given set. * <p> * This method uses the implementation in the decorators subpackage. * * @param set the set to make unmodifiable, must not be null * @return an unmodifiable set backed by the given set * @throws IllegalArgumentException if the set is null */ public static Set unmodifiableSet(Set set) { return UnmodifiableSet.decorate(set); }
/** * Factory method to create an unmodifiable set. * * @param set the set to decorate, must not be null * @throws IllegalArgumentException if set is null */ public static Set decorate(Set set) { if (set instanceof Unmodifiable) { return set; } return new UnmodifiableSet(set); }
public Iterator iterator() { return UnmodifiableIterator.decorate(getCollection().iterator()); }
/** * Returns an unmodifiable set backed by the given set. * <p> * This method uses the implementation in the decorators subpackage. * * @param set the set to make unmodifiable, must not be null * @return an unmodifiable set backed by the given set * @throws IllegalArgumentException if the set is null */ public static Set unmodifiableSet(Set set) { return UnmodifiableSet.decorate(set); }
/** * Factory method to create an unmodifiable set. * * @param set the set to decorate, must not be null * @throws IllegalArgumentException if set is null */ public static Set decorate(Set set) { if (set instanceof Unmodifiable) { return set; } return new UnmodifiableSet(set); }
public Iterator iterator() { return UnmodifiableIterator.decorate(getCollection().iterator()); }
/** * Gets an unmodifiable view as a Set. * * @return an unmodifiable set view */ public Set asSet() { return UnmodifiableSet.decorate(set); }
/** * Factory method to create an unmodifiable set. * * @param set the set to decorate, must not be null * @throws IllegalArgumentException if set is null */ public static Set decorate(Set set) { if (set instanceof Unmodifiable) { return set; } return new UnmodifiableSet(set); }
public Iterator iterator() { return UnmodifiableIterator.decorate(getCollection().iterator()); }
/** * Gets a Set of MapEntry objects that are the mappings for this BeanMap. * <p> * Each MapEntry can be set but not removed. * * @return the unmodifiable set of mappings */ public Set entrySet() { return UnmodifiableSet.decorate(new AbstractSet() { public Iterator iterator() { return entryIterator(); } public int size() { return BeanMap.this.readMethods.size(); } }); }
/** * Factory method to create an unmodifiable set. * * @param set the set to decorate, must not be null * @throws IllegalArgumentException if set is null */ public static Set decorate(Set set) { if (set instanceof Unmodifiable) { return set; } return new UnmodifiableSet(set); }
/** * Gets a Set of MapEntry objects that are the mappings for this BeanMap. * <p> * Each MapEntry can be set but not removed. * * @return the unmodifiable set of mappings */ public Set entrySet() { return UnmodifiableSet.decorate(new AbstractSet() { public Iterator iterator() { return entryIterator(); } public int size() { return BeanMap.this.readMethods.size(); } }); }
/** * Factory method to create an unmodifiable set. * * @param set the set to decorate, must not be null * @throws IllegalArgumentException if set is null */ public static Set decorate(Set set) { if (set instanceof Unmodifiable) { return set; } return new UnmodifiableSet(set); }
public Set entrySet() { Set set = map.entrySet(); // unmodifiable set will still allow modification via Map.Entry objects return UnmodifiableSet.decorate(set); }
/** * Factory method to create an unmodifiable set. * * @param set the set to decorate, must not be null * @throws IllegalArgumentException if set is null */ public static Set decorate(Set set) { if (set instanceof Unmodifiable) { return set; } return new UnmodifiableSet(set); }
/** * Returns an unmodifiable view of the underlying map's key set. * * @return the set of unique elements in this bag */ public Set uniqueSet() { if (uniqueSet == null) { uniqueSet = UnmodifiableSet.decorate(map.keySet()); } return uniqueSet; }
import org.apache.commons.collections.set.UnmodifiableSet import scala.collection.JavaConverters._ val u = new UnmodifiableSet() val s = u.asScala.toSet println(s)