Tabnine Logo
org.apache.commons.collections.set
Code IndexAdd Tabnine to your IDE (free)

How to use org.apache.commons.collections.set

Best Java code snippets using org.apache.commons.collections.set (Showing top 20 results out of 315)

origin: commons-collections/commons-collections

/**
 * Factory method to create an ordered set.
 * <p>
 * An <code>ArrayList</code> is used to retain order.
 * 
 * @param set  the set to decorate, must not be null
 * @throws IllegalArgumentException if set is null
 */
public static ListOrderedSet decorate(Set set) {
  return new ListOrderedSet(set);
}
origin: commons-collections/commons-collections

/**
 * Factory method to create a set from a map.
 * 
 * @param map  the map to decorate, must not be null
 * @throws IllegalArgumentException if set is null
 */
public static Set decorate(Map map) {
  return decorate(map, null);
}
origin: commons-collections/commons-collections

/**
 * Gets an unmodifiable view as a Set.
 * 
 * @return an unmodifiable set view
 */
public Set asSet() {
  return UnmodifiableSet.decorate(set);
}
origin: commons-collections/commons-collections

public void testContains() {
  CompositeSet set = new CompositeSet(new Set[]{buildOne(), buildTwo()});
  assertTrue(set.contains("1"));
}

origin: commons-collections/commons-collections

/**
 * Returns a typed sorted set backed by the given set.
 * <p>
 * Only objects of the specified type can be added to the set.
 * 
 * @param set  the set to limit to a specific type, must not be null
 * @param type  the type of objects which may be added to the set
 * @return a typed set backed by the specified set
 */
public static SortedSet typedSortedSet(SortedSet set, Class type) {
  return TypedSortedSet.decorate(set, type);
}

origin: commons-collections/commons-collections

/**
 * Add an array of sets to this composite
 * @param comps
 * @throws IllegalArgumentException if any of the collections in comps do not implement Set
 */
public synchronized void addComposited(Collection[] comps) {
  for (int i = comps.length - 1; i >= 0; --i) {
    this.addComposited(comps[i]);
  }
}

origin: commons-collections/commons-collections

/**
 * Gets the set being decorated.
 * 
 * @return the decorated set
 */
protected Set getSet() {
  return (Set) getCollection();
}
origin: commons-collections/commons-collections

/**
 * Gets the sorted set being decorated.
 * 
 * @return the decorated set
 */
protected SortedSet getSortedSet() {
  return (SortedSet) getCollection();
}

origin: commons-collections/commons-collections

/**
 * Factory method to create a synchronized set.
 * 
 * @param set  the set to decorate, must not be null
 * @throws IllegalArgumentException if set is null
 */
public static SortedSet decorate(SortedSet set) {
  return new SynchronizedSortedSet(set);
}

origin: commons-collections/commons-collections

/**
 * Gets the set being decorated.
 * 
 * @return the decorated set
 */
protected Set getSet() {
  return (Set) getCollection();
}
origin: commons-collections/commons-collections

public void testComparator() {
  setupSet();
  Comparator c = set.comparator();
  assertTrue("natural order, so comparator should be null", c == null);
}
origin: commons-collections/commons-collections

public void testGetSet() {
   Set set = makeTestSet();
  assertTrue("returned set should not be null",
    ((PredicatedSet) set).getSet() != null);
}

origin: commons-collections/commons-collections

public void testGetSet() {
  SortedSet set = makeTestSet();
  assertTrue("returned set should not be null",
    ((PredicatedSortedSet) set).getSet() != null);
}

origin: commons-collections/commons-collections

/**
 * Bulk test {@link SortedSet#tailSet(Object)}.  This method runs through all of
 * the tests in {@link AbstractTestSortedSet}.
 * After modification operations, {@link #verify()} is invoked to ensure
 * that the set and the other collection views are still valid.
 *
 * @return a {@link AbstractTestSet} instance for testing a tailset.
 */
public BulkTest bulkTestSortedSetTailSet() {
  int length = getFullElements().length;
  int lobound = length / 3;
  return new TestSortedSetSubSet(lobound, false);
}
origin: commons-collections/commons-collections

public Set makeFullSet() {
  SortedSet s = (SortedSet) AbstractTestSortedSet.this.makeFullCollection();
  return getSubSet(s);
}

origin: commons-collections/commons-collections

public Set makeEmptySet() {
  SortedSet s = (SortedSet) AbstractTestSortedSet.this.makeEmptySet();
  return getSubSet(s);
}
origin: commons-collections/commons-collections

/**
 * Makes an empty collection by invoking {@link #makeEmptySet()}.  
 *
 * @return an empty collection
 */
public final Collection makeCollection() {
  return makeEmptySet();
}
origin: commons-collections/commons-collections

/**
 * Makes a full collection by invoking {@link #makeFullSet()}.
 *
 * @return a full collection
 */
public final Collection makeFullCollection() {
  return makeFullSet();
}
origin: commons-collections/commons-collections

/**
 * Bulk test {@link SortedSet#headSet(Object)}.  This method runs through all of
 * the tests in {@link AbstractTestSortedSet}.
 * After modification operations, {@link #verify()} is invoked to ensure
 * that the set and the other collection views are still valid.
 *
 * @return a {@link AbstractTestSet} instance for testing a headset.
 */
public BulkTest bulkTestSortedSetHeadSet() {
  int length = getFullElements().length;
  int lobound = length / 3;
  int hibound = lobound * 2;
  return new TestSortedSetSubSet(hibound, true);
}
origin: commons-collections/commons-collections

/**
 * Bulk test {@link SortedSet#subSet(Object, Object)}.  This method runs through all of
 * the tests in {@link AbstractTestSortedSet}.
 * After modification operations, {@link #verify()} is invoked to ensure
 * that the set and the other collection views are still valid.
 *
 * @return a {@link AbstractTestSet} instance for testing a subset.
 */
public BulkTest bulkTestSortedSetSubSet() {
  int length = getFullElements().length;
  int lobound = length / 3;
  int hibound = lobound * 2;
  return new TestSortedSetSubSet(lobound, hibound);
}
org.apache.commons.collections.set

Most used classes

  • ListOrderedSet
    Decorates another Set to ensure that the order of addition is retained and used by the iterator. If
  • UnmodifiableSet
    Decorates another Set to ensure it can't be altered. This class is Serializable from Commons Collect
  • MapBackedSet
    Decorates a Map to obtain Set behaviour. This class is used to create a Set with the same properties
  • PredicatedSet
    Decorates another Set to validate that all additions match a specified predicate. This set exists to
  • PredicatedSortedSet
    Decorates another SortedSet to validate that all additions match a specified predicate. This set exi
  • SynchronizedSortedSet,
  • TransformedSet,
  • TransformedSortedSet,
  • TypedSet,
  • TypedSortedSet,
  • UnmodifiableSortedSet,
  • CompositeSet,
  • AbstractSetDecorator,
  • AbstractSortedSetDecorator,
  • CompositeSet$SetMutator,
  • ListOrderedSet$OrderedSetIterator,
  • AbstractTestSet,
  • AbstractTestSortedSet$TestSortedSetSubSet,
  • AbstractTestSortedSet
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now