Package net.sf.saxon.expr.sort
Class CustomSet<T>
- java.lang.Object
- 
- net.sf.saxon.expr.sort.CustomSet<T>
 
- 
- Type Parameters:
- T- The type of the entries in the set
 
 public class CustomSet<T> extends java.lang.ObjectA mutable set implementation using a custom equality matcher, to avoid having to wrap each entry in a wrapper object to achieve customised equality testing.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 SummaryConstructors Constructor Description CustomSet(EqualityMatcher<T> matcher)Create an empty set using the supplied equality matcher
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(T value)Add a value to the setbooleancontains(T value)Ask if a value exists in the set
 
- 
- 
- 
Constructor Detail- 
CustomSetpublic CustomSet(EqualityMatcher<T> matcher) Create an empty set using the supplied equality matcher- Parameters:
- matcher- the function used to compare items for equality
 
 
- 
 - 
Method Detail- 
addpublic boolean add(T value) Add a value to the set- Parameters:
- value- the value to be added.
- Returns:
- true if the value is newly added, that is, if it was not already present
 
 - 
containspublic boolean contains(T value) Ask if a value exists in the set- Parameters:
- value- the requested value
- Returns:
- true if it exists
 
 
- 
 
-