org.metasyntactic.math.algebra
Interface Set

All Superinterfaces:
java.util.Collection, java.util.Set
All Known Subinterfaces:
AbelianGroup, Field, Group, Groupoid, Monoid, Ring, Semigroup
All Known Implementing Classes:
AbstractField

public interface Set
extends java.util.Set

A set is a collection of distinguishable objects, called its members or elements. If an object x is a member of a set S, we write x ∈ S (read "x is a member of S" or, more briefly, "x is in S"). If x is not a member of S, we write x ∉ S. We can describe a set by explicitly listing its members as a list inside braces. For example, we can define a set S to contain precisely the numbers 1, 2, and 3 by writing S = {1, 2, 3}. Since 2 is a member of the set S we can write 2 ∈ S, and since 4 is not a member, we have 4 ∉ S. A set cannot contain the same object more then once, and its elements are not ordered. Two sets A and B are equal, written A = B, if they contain the same elements. For example, {1, 2, 3, 1} = {1, 2, 3} = {3, 2, 1}.

We adopt special notations for frequently encountered sets.

For any set A, we have AA. For two sets A and B, we have A = B if and only if AB and BA. For any three sets A, B, and C, if AB and BC, then AC. For any set A we have ∅ ⊆ A.


Method Summary
 Set difference(Set c)
           The difference of sets A and B is the set
 Set intersection(Set c)
           The intersection of sets A and B is the set
 Set union(Set c)
           The union of sets A and B is the set
 
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Method Detail

intersection

public Set intersection(Set c)

The intersection of sets A and B is the set

AB = {x | x ∈ A and x ∈ B}.

Note! Neither set is affected by this operation. To make this set equal to the intersection of itself and c use retainAll(Collection c)

Returns:
The set equal to the intersection of this set and c
See Also:
Set.retainAll(Collection c)

union

public Set union(Set c)

The union of sets A and B is the set

AB = {x | x ∈ A or x ∈ B}.

Note! Neither set is affected by this operation. TO make this set equal to the union of itself and c use addAll(Collection c)

Returns:
the set equal to the union of this and c
See Also:
Set.addAll(Collection c)

difference

public Set difference(Set c)

The difference of sets A and B is the set

A - B = {x | x ∈ A and x ∉ B}.

Note! Neither set is affected by this operation. To make this set equal to the difference of itself and c use removeAll(Collection c)

Returns:
the Set equal to the difference of this and c
See Also:
Set.removeAll(Collection c)