|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--iglu.util.SetTools
Provides utility methods for dealing with Sets.
Constructor Summary | |
private |
SetTools()
|
Method Summary | |
static void |
exportToFile(java.util.Set s,
java.io.File file)
Writes the set to a file, one item per line. |
static java.util.Set |
importSet(java.io.File file)
Converts a file into a set. |
static java.util.Set |
intersection(java.util.Set first,
java.util.Set second)
Deprecated. use java.util.Set.retainAll(Collection) instead. |
static void |
main(java.lang.String[] args)
Runs some test examples on the methods of this class. |
static void |
test()
Runs some test examples on the methods of this class. |
static java.util.Set |
union(java.util.Set first,
java.util.Set second)
Deprecated. use java.util.Set.addAll(Collection) instead. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
private SetTools()
Method Detail |
public static java.util.Set union(java.util.Set first, java.util.Set second)
Set
s. This operation
does not affect either of the original sets. Note that the
items within the sets are not cloned, so outside
modifications may affect the contents of the set.
If the sets have differing implementations, the returned
set has the same implementation as first
. If
first
is a TreeSet
,
the set returned uses the same Comparator as first
.
java.lang.NullPointerException
- if one of the two sets is null.public static java.util.Set intersection(java.util.Set first, java.util.Set second)
Set
s. This
operation does not affect either of the original sets. Note
that the items within the sets are not cloned, so
outside modifications may affect the contents of the set.
If the sets have differing implementations, the returned
set has the same implementation as first
. If
first
is a TreeSet
,
the set returned uses the same Comparator as first
.
java.lang.NullPointerException
- if one of the two sets is null.public static java.util.Set importSet(java.io.File file) throws java.io.FileNotFoundException
java.io.FileNotFoundException
public static void exportToFile(java.util.Set s, java.io.File file)
public static void test()
public static void main(java.lang.String[] args)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |