E - element typepublic class WeightedUnmodifiableSet<E>
extends java.util.AbstractSet<E>
implements java.io.Serializable
hashCode() and equals() methods are identical to those
of a normal set, i.e. they are independent of the weight of this class. All methods are
delegated to the underlying set.| Modifier and Type | Field and Description |
|---|---|
java.util.Set<E> |
backingSet |
double |
weight |
| Constructor and Description |
|---|
WeightedUnmodifiableSet(java.util.Set<E> backingSet)
Constructs a WeightedUnmodifiableSet instance
|
WeightedUnmodifiableSet(java.util.Set<E> backingSet,
double weight)
Constructs a WeightedUnmodifiableSet instance
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E v) |
boolean |
addAll(java.util.Collection<? extends E> c) |
void |
clear() |
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection<?> c) |
boolean |
equals(java.lang.Object o) |
double |
getWeight()
Returns the weight of the set.
|
int |
hashCode() |
boolean |
isEmpty() |
java.util.Iterator<E> |
iterator() |
boolean |
remove(java.lang.Object o) |
boolean |
removeAll(java.util.Collection<?> c) |
boolean |
retainAll(java.util.Collection<?> c) |
int |
size() |
java.lang.Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
public final java.util.Set<E> backingSet
public final double weight
public WeightedUnmodifiableSet(java.util.Set<E> backingSet)
backingSet - underlying setpublic WeightedUnmodifiableSet(java.util.Set<E> backingSet, double weight)
backingSet - underlying setweight - weight of the setpublic double getWeight()
public int size()
public boolean isEmpty()
public boolean contains(java.lang.Object o)
public java.util.Iterator<E> iterator()
public java.lang.Object[] toArray()
public <T> T[] toArray(T[] a)
public boolean add(E v)
public boolean remove(java.lang.Object o)
public boolean containsAll(java.util.Collection<?> c)
public boolean addAll(java.util.Collection<? extends E> c)
public boolean retainAll(java.util.Collection<?> c)
public boolean removeAll(java.util.Collection<?> c)
public void clear()
public boolean equals(java.lang.Object o)
Copyright © 2019. All Rights Reserved.