Class DiagnosticFrequencyMap.Unlimited
- java.lang.Object
-
- org.eclipse.emfforms.spi.common.validation.DiagnosticFrequencyMap.Unlimited
-
- All Implemented Interfaces:
java.lang.Iterable<org.eclipse.emf.common.util.Diagnostic>
,DiagnosticFrequencyMap
- Direct Known Subclasses:
DiagnosticFrequencyMap.Limited
- Enclosing interface:
- DiagnosticFrequencyMap
public static class DiagnosticFrequencyMap.Unlimited extends java.lang.Object implements DiagnosticFrequencyMap
A frequency map of unlimited size that keeps all diagnostics added to it.- Since:
- 1.21
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.emfforms.spi.common.validation.DiagnosticFrequencyMap
DiagnosticFrequencyMap.Limited, DiagnosticFrequencyMap.Unlimited
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(org.eclipse.emf.common.util.Diagnostic diagnostic)
Add a diagnostic.void
addDiagnosticFilter(java.util.function.Predicate<? super org.eclipse.emf.common.util.Diagnostic> filter)
Add a predicate that matches diagnostics that should be collected.void
appendTo(java.util.Collection<? super org.eclipse.emf.common.util.Diagnostic> diagnostics)
Append the diagnostics that I have collected, in decreasing severity order, to a collection ofdiagnostics
.void
clear()
Remove all diagnostics and histogram counts.int
getDiscardedSeverity()
Query the greatest severity of diagnostics that had to be discarded because the map filled up.boolean
isEmpty()
Queries whether I am empty of any diagnostics.boolean
isFull()
Queries whether I am full to capacity, unable to accept any more diagnostics.java.util.Iterator<org.eclipse.emf.common.util.Diagnostic>
iterator()
int
size()
Queries the number of diagnostics that I contain.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.emfforms.spi.common.validation.DiagnosticFrequencyMap
addAll
-
-
-
-
Method Detail
-
clear
public void clear()
Description copied from interface:DiagnosticFrequencyMap
Remove all diagnostics and histogram counts.- Specified by:
clear
in interfaceDiagnosticFrequencyMap
-
size
public int size()
Description copied from interface:DiagnosticFrequencyMap
Queries the number of diagnostics that I contain.- Specified by:
size
in interfaceDiagnosticFrequencyMap
- Returns:
- my size
-
isEmpty
public boolean isEmpty()
Description copied from interface:DiagnosticFrequencyMap
Queries whether I am empty of any diagnostics.- Specified by:
isEmpty
in interfaceDiagnosticFrequencyMap
- Returns:
true
I have no diagnostics;false
, otherwise
-
isFull
public boolean isFull()
Description copied from interface:DiagnosticFrequencyMap
Queries whether I am full to capacity, unable to accept any more diagnostics.- Specified by:
isFull
in interfaceDiagnosticFrequencyMap
- Returns:
true
if I have reached my limit of diagnostics;false
, otherwise
-
getDiscardedSeverity
public int getDiscardedSeverity()
Description copied from interface:DiagnosticFrequencyMap
Query the greatest severity of diagnostics that had to be discarded because the map filled up.- Specified by:
getDiscardedSeverity
in interfaceDiagnosticFrequencyMap
- Returns:
- the highest discarded severity, or
Diagnostic.OK
if no diagnostics were discarded
-
add
public boolean add(org.eclipse.emf.common.util.Diagnostic diagnostic)
Description copied from interface:DiagnosticFrequencyMap
Add a diagnostic.- Specified by:
add
in interfaceDiagnosticFrequencyMap
- Parameters:
diagnostic
- a diagnostic to add- Returns:
true
if it was added;false
, otherwise, for example if I am full
-
addDiagnosticFilter
public void addDiagnosticFilter(java.util.function.Predicate<? super org.eclipse.emf.common.util.Diagnostic> filter)
Description copied from interface:DiagnosticFrequencyMap
Add a predicate that matches diagnostics that should be collected. Diagnostics that do not match the filter are discarded, but their severity is retained for separate reporting if the client should so wish. A diagnostic is only accepted that satisfies allfilter
s (overall, it's a conjunction).- Specified by:
addDiagnosticFilter
in interfaceDiagnosticFrequencyMap
- Parameters:
filter
- a predicate matching diagnostics to accept
-
appendTo
public void appendTo(java.util.Collection<? super org.eclipse.emf.common.util.Diagnostic> diagnostics)
Description copied from interface:DiagnosticFrequencyMap
Append the diagnostics that I have collected, in decreasing severity order, to a collection ofdiagnostics
.- Specified by:
appendTo
in interfaceDiagnosticFrequencyMap
- Parameters:
diagnostics
- a collection of diagnostics to append to
-
iterator
public java.util.Iterator<org.eclipse.emf.common.util.Diagnostic> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<org.eclipse.emf.common.util.Diagnostic>
-
-