Package org.apache.rat.utils
Class ReportingSet<T>
java.lang.Object
org.apache.rat.utils.ReportingSet<T>
- Type Parameters:
T- the type of object
- All Implemented Interfaces:
Iterable<T>,Collection<T>,Set<T>,SortedSet<T>
A sorted set that reports insertion collisions.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe Options for duplicate processing -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddAll(Collection<? extends T> c)booleanaddAllIfNotPresent(Collection<? extends T> c)booleanaddIfNotPresent(T e)Adds the item if it is not present.voidclear()Comparator<? super T>booleanbooleancontainsAll(Collection<?> c)booleanfirst()voidinthashCode()booleanisEmpty()iterator()last()booleanbooleanremoveAll(Collection<?> c)booleanbooleanretainAll(Collection<?> c)If set true attempts to duplicate will throw an IllegalArgumentException.setLogLevel(Log.Level level)Sets the log level that the reporting set will log at.setMsgFormat(Function<T,String> msgFmt)Sets the function to generate the log message.intsize()stream()Object[]toArray()<T> T[]toArray(T[] a)
-
Constructor Details
-
ReportingSet
Constructs.- Parameters:
delegate- the SortedSet to delegate to.
-
-
Method Details
-
setMsgFormat
Sets the function to generate the log message.- Parameters:
msgFmt- A function to return the string to be displayed when a collision occurs.- Returns:
- This for chaining.
-
setDuplicateOption
If set true attempts to duplicate will throw an IllegalArgumentException. The default state is false;.- Parameters:
state- the state to set.- Returns:
- this for chaining.
-
setLogLevel
Sets the log level that the reporting set will log at. if not set the default level is WARN.- Parameters:
level- the log level to use.- Returns:
- this for chaining.
-
addIfNotPresent
Adds the item if it is not present. Does not report collisions.- Parameters:
e- the item to add.- Returns:
- true if the item was added, false otherwise.
-
add
-
addAll
-
addAllIfNotPresent
-
clear
public void clear() -
comparator
- Specified by:
comparatorin interfaceSortedSet<T>
-
contains
-
containsAll
- Specified by:
containsAllin interfaceCollection<T>- Specified by:
containsAllin interfaceSet<T>
-
equals
-
first
-
forEach
-
hashCode
public int hashCode() -
headSet
-
isEmpty
public boolean isEmpty() -
iterator
-
last
-
parallelStream
- Specified by:
parallelStreamin interfaceCollection<T>
-
remove
-
removeAll
-
removeIf
- Specified by:
removeIfin interfaceCollection<T>
-
retainAll
-
size
public int size() -
spliterator
- Specified by:
spliteratorin interfaceCollection<T>- Specified by:
spliteratorin interfaceIterable<T>- Specified by:
spliteratorin interfaceSet<T>- Specified by:
spliteratorin interfaceSortedSet<T>
-
stream
- Specified by:
streamin interfaceCollection<T>
-
subSet
-
tailSet
-
toArray
-
toArray
public <T> T[] toArray(T[] a)
-