T
- The type of the entries in the setpublic class CustomSet<T>
extends java.lang.Object
Note: this doesn't implement java.util.Set<T>
. This is to save the effort of implementing
methods like size() and iterator() that aren't required for our use cases. These
methods could easily be added without changing the basic design.
Constructor and Description |
---|
CustomSet(EqualityMatcher<T> matcher)
Create an empty set using the supplied equality matcher
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(T value)
Add a value to the set
|
boolean |
contains(T value)
Ask if a value exists in the set
|
public CustomSet(EqualityMatcher<T> matcher)
matcher
- the function used to compare items for equalitypublic boolean add(T value)
value
- the value to be added.public boolean contains(T value)
value
- the requested valueCopyright (c) 2004-2022 Saxonica Limited. All rights reserved.