Package components.set
Interface Set<T>
- Type Parameters:
T- type ofSetentries
- All Known Implementing Classes:
Set1L,Set2,Set3,Set4,SetSecondary
SetKernel enhanced with secondary methods.-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds tothisall elements ofsthat are not already inthis, also removing just those elements froms.booleanReports whetherthisis a subset ofs.Removes fromthisall elements ofsthat are also inthis, leavingsunchanged, and returns the elements actually removed.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods inherited from interface components.standard.Standard
clear, newInstance, transferFrom
-
Method Details
-
add
Adds tothisall elements ofsthat are not already inthis, also removing just those elements froms.- Parameters:
s- theSetwhose elements are to be added tothis- Updates:
this, s- Ensures:
this = #this union #s and s = #this intersection #s
-
remove
Removes fromthisall elements ofsthat are also inthis, leavingsunchanged, and returns the elements actually removed.- Parameters:
s- theSetwhose elements are to be removed fromthis- Returns:
- the
Setwhose elements actually were removed fromthis - Updates:
this- Ensures:
this = #this \ s and remove = #this intersection s
-
isSubset
Reports whetherthisis a subset ofs.- Parameters:
s- the second set- Returns:
- whether
thisis a subset ofs - Ensures:
isSubset = this is subset of s
-