Package components.set
Interface Set<T>
- Type Parameters:
T
- type ofSet
entries
- All Known Implementing Classes:
Set1L
,Set2
,Set3
,Set4
,SetSecondary
SetKernel
enhanced with secondary methods.-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds tothis
all elements ofs
that are not already inthis
, also removing just those elements froms
.boolean
Reports whetherthis
is a subset ofs
.Removes fromthis
all elements ofs
that are also inthis
, leavings
unchanged, and returns the elements actually removed.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
Methods inherited from interface components.standard.Standard
clear, newInstance, transferFrom
-
Method Details
-
add
Adds tothis
all elements ofs
that are not already inthis
, also removing just those elements froms
.- Parameters:
s
- theSet
whose elements are to be added tothis
- Updates:
this, s
- Ensures:
this = #this union #s and s = #this intersection #s
-
remove
Removes fromthis
all elements ofs
that are also inthis
, leavings
unchanged, and returns the elements actually removed.- Parameters:
s
- theSet
whose elements are to be removed fromthis
- Returns:
- the
Set
whose elements actually were removed fromthis
- Updates:
this
- Ensures:
this = #this \ s and remove = #this intersection s
-
isSubset
Reports whetherthis
is a subset ofs
.- Parameters:
s
- the second set- Returns:
- whether
this
is a subset ofs
- Ensures:
isSubset = this is subset of s
-