protected abstract class AbstractExtendedSet.FilteredSet extends Object implements ExtendedSet<T>
AbstractExtendedSet.ExtendedSubSet and AbstractExtendedSet.UnmodifiableExtendedSetExtendedSet.ExtendedIterator<X>| Modifier | Constructor and Description |
|---|---|
protected |
AbstractExtendedSet.FilteredSet() |
| Modifier and Type | Method and Description |
|---|---|
double |
bitmapCompressionRatio()
|
ExtendedSet<T> |
clone()
See the
clone() of Object |
double |
collectionCompressionRatio()
|
Comparator<? super T> |
comparator() |
int |
compareTo(ExtendedSet<T> o)
Compares this object with the specified object for order.
|
ExtendedSet<T> |
complemented()
Generates the complement set.
|
int |
complementSize()
Computes the complement set size.
|
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
boolean |
containsAny(Collection<? extends T> other)
Returns
true if the specified Collection instance
contains any elements that are also contained within this
ExtendedSet instance |
boolean |
containsAtLeast(Collection<? extends T> other,
int minElements)
Returns
true if the specified Collection instance
contains at least minElements elements that are also
contained within this ExtendedSet instance |
ExtendedSet<T> |
convert(Collection<?> c)
Converts a given
Collection instance into an instance of the
current class. |
ExtendedSet<T> |
convert(Object... e)
Converts a given integer array into an instance of the current class
|
String |
debugInfo()
Prints debug info about the given
ExtendedSet implementation |
Iterable<T> |
descending()
Allows to use the Java "for-each" statement in descending order
|
ExtendedSet.ExtendedIterator<T> |
descendingIterator()
Gets the descending order iterator over the elements of type
T |
ExtendedSet<T> |
difference(Collection<? extends T> other)
Generates the difference set
|
int |
differenceSize(Collection<? extends T> other)
Computes the difference set size.
|
ExtendedSet<T> |
empty()
Generates an empty set
|
boolean |
equals(Object o) |
T |
first() |
T |
get(int i)
Gets the
ith element of the set |
int |
hashCode() |
int |
indexOf(T e)
Provides position of element within the set.
|
ExtendedSet<T> |
intersection(Collection<? extends T> other)
Generates the intersection set
|
int |
intersectionSize(Collection<? extends T> other)
Computes the intersection set size.
|
boolean |
isEmpty() |
ExtendedSet.ExtendedIterator<T> |
iterator() |
double |
jaccardDistance(ExtendedSet<T> other)
Computes the Jaccard distance between this set and the given set.
|
double |
jaccardSimilarity(ExtendedSet<T> other)
Computes the Jaccard similarity coefficient between this set and the
given set.
|
T |
last() |
List<? extends ExtendedSet<T>> |
powerSet()
Computes the power-set of the current set.
|
List<? extends ExtendedSet<T>> |
powerSet(int mins,
int maxs)
Computes a subset of the power-set of the current set, composed by those
subsets that have cardinality between
min and
max. |
int |
powerSetSize()
Computes the power-set size of the current set.
|
int |
powerSetSize(int mins,
int maxs)
Computes the power-set size of the current set, composed by those subsets
that have cardinality between
min and max. |
protected abstract ExtendedSet<T> |
raw() |
int |
size() |
ExtendedSet<T> |
symmetricDifference(Collection<? extends T> other)
Generates the symmetric difference set
|
int |
symmetricDifferenceSize(Collection<? extends T> other)
Computes the symmetric difference set size.
|
Object[] |
toArray() |
<X> X[] |
toArray(X[] a) |
String |
toString() |
ExtendedSet<T> |
union(Collection<? extends T> other)
Generates the union set
|
int |
unionSize(Collection<? extends T> other)
Computes the union set size.
|
ExtendedSet<T> |
unmodifiable()
Gets the read-only version of the current set
|
double |
weightedJaccardDistance(ExtendedSet<T> other)
Computes the weighted version of the Jaccard distance between this set
and the given set.
|
double |
weightedJaccardSimilarity(ExtendedSet<T> other)
Computes the weighted version of the Jaccard similarity coefficient
between this set and the given set.
|
finalize, getClass, notify, notifyAll, wait, wait, waitclear, complement, fill, flip, headSet, subSet, tailSetprotected abstract ExtendedSet<T> raw()
public ExtendedSet<T> convert(Collection<?> c)
ExtendedSetCollection instance into an instance of the
current class. NOTE: when the collection is already an instance of
the current class, the method returns the collection itself.convert in interface ExtendedSet<T>c - collection to use to generate the new instanceExtendedSet.convert(Object...)public ExtendedSet<T> convert(Object... e)
ExtendedSetconvert in interface ExtendedSet<T>e - objects to use to generate the new instanceExtendedSet.convert(Collection)public ExtendedSet<T> clone()
ExtendedSetclone() of Objectclone in interface ExtendedSet<T>clone in class Objectpublic ExtendedSet<T> empty()
ExtendedSetempty in interface ExtendedSet<T>public Comparator<? super T> comparator()
comparator in interface SortedSet<T>public ExtendedSet<T> unmodifiable()
ExtendedSetunmodifiable in interface ExtendedSet<T>public ExtendedSet.ExtendedIterator<T> iterator()
ExtendedSetpublic ExtendedSet.ExtendedIterator<T> descendingIterator()
ExtendedSetTdescendingIterator in interface ExtendedSet<T>public boolean isEmpty()
public boolean equals(Object o)
public int hashCode()
public int compareTo(ExtendedSet<T> o)
ExtendedSetIntSet
instance A is less than another IntSet instance
B if B-A (that is, the elements in
B that are not contained in A) contains at
least one element that is greater than all the elements in
A-B.
The implementor must ensure sgn(x.compareTo(y)) == -sgn(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception iff y.compareTo(x) throws an exception.)
The implementor must also ensure that the relation is transitive: (x.compareTo(y)>0 && y.compareTo(z)>0) implies x.compareTo(z)>0.
Finally, the implementor must ensure that x.compareTo(y)==0 implies that sgn(x.compareTo(z)) == sgn(y.compareTo(z)), for all z.
It is strongly recommended, but not strictly required that (x.compareTo(y)==0) == (x.equals(y)). Generally speaking, any class that implements the Comparable interface and violates this condition should clearly indicate this fact. The recommended language is "Note: this class has a natural ordering that is inconsistent with equals."
In the foregoing description, the notation sgn(expression ) designates the mathematical signum function, which is defined to return one of -1, 0, or 1 according to whether the value of expression is negative, zero or positive.
compareTo in interface ExtendedSet<T>compareTo in interface Comparable<ExtendedSet<T>>o - the object to be compared.public double bitmapCompressionRatio()
ExtendedSetBitSet, 2 means twice the size of BitSet, etc.)bitmapCompressionRatio in interface ExtendedSet<T>public double collectionCompressionRatio()
ExtendedSetArrayList, 2 means twice the size of ArrayList, etc.)collectionCompressionRatio in interface ExtendedSet<T>public List<? extends ExtendedSet<T>> powerSet()
ExtendedSetIt is a particular implementation of the algorithm Apriori (see: Rakesh Agrawal, Ramakrishnan Srikant, Fast Algorithms for Mining Association Rules in Large Databases, in Proceedings of the 20th International Conference on Very Large Data Bases, p.487-499, 1994). The returned power-set does not contain the empty set.
The subsets composing the powerset are returned in a list that is sorted according to the lexicographical order provided by the sorted set.
powerSet in interface ExtendedSet<T>ExtendedSet.powerSet(int, int),
ExtendedSet.powerSetSize()public List<? extends ExtendedSet<T>> powerSet(int mins, int maxs)
ExtendedSetmin and
max.
It is a particular implementation of the algorithm Apriori (see: Rakesh Agrawal, Ramakrishnan Srikant, Fast Algorithms for Mining Association Rules in Large Databases, in Proceedings of the 20th International Conference on Very Large Data Bases, p.487-499, 1994). The power-set does not contains the empty set.
The subsets composing the powerset are returned in a list that is sorted according to the lexicographical order provided by the sorted set.
powerSet in interface ExtendedSet<T>mins - minimum subset size (greater than zero)maxs - maximum subset sizeExtendedSet.powerSet(),
ExtendedSet.powerSetSize(int, int)public int powerSetSize()
ExtendedSetThe power-set does not contains the empty set.
powerSetSize in interface ExtendedSet<T>ExtendedSet.powerSet()public int powerSetSize(int mins,
int maxs)
ExtendedSetmin and max.
The returned power-set does not contain the empty set.
powerSetSize in interface ExtendedSet<T>mins - minimum subset size (greater than zero)maxs - maximum subset sizeExtendedSet.powerSet(int, int)public Object[] toArray()
public <X> X[] toArray(X[] a)
public ExtendedSet<T> complemented()
ExtendedSetSortedSet.last() that do not exist in the
current set.complemented in interface ExtendedSet<T>ExtendedSet.complement()public int complementSize()
ExtendedSet
This is faster than calling ExtendedSet.complemented() and then
Set.size()
complementSize in interface ExtendedSet<T>public int size()
public boolean contains(Object o)
public Iterable<T> descending()
ExtendedSetdescending in interface ExtendedSet<T>Iterable instance to iterate items in descending
orderpublic String debugInfo()
ExtendedSetExtendedSet implementationdebugInfo in interface ExtendedSet<T>public T get(int i)
ExtendedSetith element of the setget in interface ExtendedSet<T>i - position of the element in the sorted setith element of the setpublic int indexOf(T e)
ExtendedSetIt returns -1 if the element does not exist within the set.
indexOf in interface ExtendedSet<T>e - element of the setpublic double jaccardDistance(ExtendedSet<T> other)
ExtendedSet
The coefficient is defined as
1 - ExtendedSet.jaccardSimilarity(ExtendedSet).
jaccardDistance in interface ExtendedSet<T>other - the other setExtendedSet.jaccardSimilarity(ExtendedSet)public double jaccardSimilarity(ExtendedSet<T> other)
ExtendedSet
The coefficient is defined as
|A intersection B| / |A union B|.
jaccardSimilarity in interface ExtendedSet<T>other - the other setExtendedSet.jaccardDistance(ExtendedSet)public double weightedJaccardDistance(ExtendedSet<T> other)
ExtendedSet
The coefficient is defined as 1 -
ExtendedSet.weightedJaccardSimilarity(ExtendedSet).
NOTE: T must be a number, namely one of
Integer, Double, Float, Byte,
Long, Short.
weightedJaccardDistance in interface ExtendedSet<T>other - the other setExtendedSet.weightedJaccardSimilarity(ExtendedSet)public double weightedJaccardSimilarity(ExtendedSet<T> other)
ExtendedSet
The coefficient is defined as
sum of min(A_i, B_i) / sum of max(A_i, B_i).
NOTE: T must be a number, namely one of
Integer, Double, Float, Byte,
Long, Short.
weightedJaccardSimilarity in interface ExtendedSet<T>other - the other setExtendedSet.weightedJaccardDistance(ExtendedSet)public ExtendedSet<T> difference(Collection<? extends T> other)
ExtendedSetdifference in interface ExtendedSet<T>other - ExtendedSet instance that represents the right
operandSet.removeAll(java.util.Collection)public ExtendedSet<T> symmetricDifference(Collection<? extends T> other)
ExtendedSetsymmetricDifference in interface ExtendedSet<T>other - ExtendedSet instance that represents the right
operandExtendedSet.flip(Object)public ExtendedSet<T> intersection(Collection<? extends T> other)
ExtendedSetintersection in interface ExtendedSet<T>other - ExtendedSet instance that represents the right
operandSet.retainAll(java.util.Collection)public ExtendedSet<T> union(Collection<? extends T> other)
ExtendedSetunion in interface ExtendedSet<T>other - ExtendedSet instance that represents the right
operandSet.addAll(java.util.Collection)public int intersectionSize(Collection<? extends T> other)
ExtendedSet
This is faster than calling ExtendedSet.intersection(Collection) and
then Set.size()
intersectionSize in interface ExtendedSet<T>other - Collection instance that represents the right
operandpublic int differenceSize(Collection<? extends T> other)
ExtendedSet
This is faster than calling ExtendedSet.difference(Collection) and
then Set.size()
differenceSize in interface ExtendedSet<T>other - Collection instance that represents the right
operandpublic int unionSize(Collection<? extends T> other)
ExtendedSet
This is faster than calling ExtendedSet.union(Collection) and then
Set.size()
unionSize in interface ExtendedSet<T>other - Collection instance that represents the right
operandpublic int symmetricDifferenceSize(Collection<? extends T> other)
ExtendedSet
This is faster than calling
ExtendedSet.symmetricDifference(Collection) and then Set.size()
symmetricDifferenceSize in interface ExtendedSet<T>other - Collection instance that represents the right
operandpublic boolean containsAll(Collection<?> c)
containsAll in interface Collection<T>containsAll in interface Set<T>public boolean containsAny(Collection<? extends T> other)
ExtendedSettrue if the specified Collection instance
contains any elements that are also contained within this
ExtendedSet instancecontainsAny in interface ExtendedSet<T>other - ExtendedSet to intersect withExtendedSet intersects
the specified ExtendedSet.public boolean containsAtLeast(Collection<? extends T> other, int minElements)
ExtendedSettrue if the specified Collection instance
contains at least minElements elements that are also
contained within this ExtendedSet instancecontainsAtLeast in interface ExtendedSet<T>other - Collection instance to intersect withminElements - minimum number of elements to be contained within this
ExtendedSet instanceExtendedSet intersects
the specified Collection.Copyright © 2016. All rights reserved.