20 package net.sf.gridarta.model.validation;
22 import java.util.ArrayList;
23 import java.util.Collections;
24 import java.util.Iterator;
25 import java.util.List;
30 import org.jetbrains.annotations.NotNull;
37 public class DefaultErrorCollector<G
extends GameObject<G, A, R>, A extends
MapArchObject<A>, R extends
Archetype<G, A, R>> implements
ErrorCollector<G, A, R>, Iterable<ValidationError<G, A, R>> {
48 private final List<ValidationError<G, A, R>>
errors =
new ArrayList<>();
63 public Iterator<ValidationError<G, A, R>>
iterator() {
68 return Collections.unmodifiableList(errors).iterator();
73 public Iterable<ValidationError<G, A, R>>
getErrors() {
A Comparator that compares ValidationError instances for display ordering.
This package contains the framework for validating maps.
final List< ValidationError< G, A, R > > errors
Errors.
Super class of all errors that could occur during map validation.
Base package of all Gridarta classes.
Reflects a game object (object on a map).
boolean sorted
Whether errors is sorted.
void collect(@NotNull final ValidationError< G, A, R > error)
GameObjects are the objects based on Archetypes found on maps.
Iterable< ValidationError< G, A, R > > getErrors()
An interface for classes that collect errors.
Iterator< ValidationError< G, A, R > > iterator()
Simple error collector that just collects the error in a collection for later retrieval through itera...
static final long serialVersionUID
The serial version UID.
Interface for MapArchObjects.