T
- The type of elements in the Setjava.io.Serializable
, java.lang.Cloneable
, java.lang.Iterable<T>
, java.util.Collection<T>
, java.util.Set<T>
public final class ResourceSet<T>
extends java.util.HashSet<T>
locked
property. This class can be used to safely expose
resource path sets to user classes without having to clone them in order
to avoid modifications. When first created, a ResourceMap
is not locked.Constructor | Description |
---|---|
ResourceSet() |
Construct a new, empty set with the default initial capacity and
load factor.
|
ResourceSet(int initialCapacity) |
Construct a new, empty set with the specified initial capacity and
default load factor.
|
ResourceSet(int initialCapacity,
float loadFactor) |
Construct a new, empty set with the specified initial capacity and
load factor.
|
ResourceSet(java.util.Collection<T> coll) |
Construct a new set with the same contents as the existing collection.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
add(T o) |
Add the specified element to this set if it is not already present.
|
void |
clear() |
Remove all of the elements from this set.
|
boolean |
isLocked() |
|
boolean |
remove(java.lang.Object o) |
Remove the given element from this set if it is present.
|
void |
setLocked(boolean locked) |
Set the locked state of this parameter map.
|
addAll, containsAll, retainAll, toArray, toArray, toString
clone, contains, isEmpty, iterator, size, spliterator
public ResourceSet()
public ResourceSet(int initialCapacity)
initialCapacity
- The initial capacity of this setpublic ResourceSet(int initialCapacity, float loadFactor)
initialCapacity
- The initial capacity of this setloadFactor
- The load factor of this setpublic ResourceSet(java.util.Collection<T> coll)
coll
- The collection whose contents we should copypublic boolean isLocked()
public void setLocked(boolean locked)
locked
- The new locked statepublic boolean add(T o)
true
if the element was added.public void clear()
public boolean remove(java.lang.Object o)
true
if the element was removed.Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.