/** * This method will take a MutableSet and wrap it directly in a SynchronizedMutableSet. It will * take any other non-Eclipse-Collections collection and first adapt it will a SetAdapter, and then return a * SynchronizedMutableSet that wraps the adapter. */ public static <E, S extends Set<E>> SynchronizedMutableSet<E> of(S set) { return new SynchronizedMutableSet<>(SetAdapter.adapt(set)); }
public static <T> MultiReaderUnifiedSet<T> newSet() { return new MultiReaderUnifiedSet<>(UnifiedSet.newSet()); }
private void assertContains( Iterable<NodeWithPropertyValues> iterable, NodeWithPropertyValues... expected ) { assertEquals( UnifiedSet.newSetWith( expected ), UnifiedSet.newSet( iterable ) ); }
public static <T> MultiReaderUnifiedSet<T> newSetWith(T... elements) { return new MultiReaderUnifiedSet<>(UnifiedSet.newSetWith(elements)); }
@Override public MutableSet<T> asSynchronized() { this.acquireReadLock(); try { return SynchronizedMutableSet.of(this); } finally { this.unlockReadLock(); } }
@Override public MutableSet<T> asUnmodifiable() { this.acquireReadLock(); try { return UnmodifiableMutableSet.of(this); } finally { this.unlockReadLock(); } }
public static <T> MultiReaderUnifiedSet<T> newSet(int capacity) { return new MultiReaderUnifiedSet<>(UnifiedSet.newSet(capacity)); }
/** * This method will take a MutableSet and wrap it directly in a SynchronizedMutableSet. It will * take any other non-Eclipse-Collections collection and first adapt it will a SetAdapter, and then return a * SynchronizedMutableSet that wraps the adapter. Additionally, a developer specifies which lock to use * with the collection. */ public static <E, S extends Set<E>> SynchronizedMutableSet<E> of(S set, Object lock) { return new SynchronizedMutableSet<>(SetAdapter.adapt(set), lock); }
@Override public MutableSet<T> asSynchronized() { this.acquireReadLock(); try { return SynchronizedMutableSet.of(this); } finally { this.unlockReadLock(); } }
public static <T> MultiReaderUnifiedSet<T> newSet(int capacity) { return new MultiReaderUnifiedSet<>(UnifiedSet.newSet(capacity)); }
/** * This method will take a MutableSet and wrap it directly in a SynchronizedMutableSet. It will * take any other non-Eclipse-Collections collection and first adapt it will a SetAdapter, and then return a * SynchronizedMutableSet that wraps the adapter. */ public static <E, S extends Set<E>> SynchronizedMutableSet<E> of(S set) { return new SynchronizedMutableSet<>(SetAdapter.adapt(set)); }
public static <T> MultiReaderUnifiedSet<T> newSet() { return new MultiReaderUnifiedSet<>(UnifiedSet.newSet()); }
/** * This method will take a MutableSet and wrap it directly in a SynchronizedMutableSet. It will * take any other non-Eclipse-Collections collection and first adapt it will a SetAdapter, and then return a * SynchronizedMutableSet that wraps the adapter. Additionally, a developer specifies which lock to use * with the collection. */ public static <E, S extends Set<E>> SynchronizedMutableSet<E> of(S set, Object lock) { return new SynchronizedMutableSet<>(SetAdapter.adapt(set), lock); }
public static <T> MultiReaderUnifiedSet<T> newSet(Iterable<T> iterable) { return new MultiReaderUnifiedSet<>(UnifiedSet.newSet(iterable)); }