R
- les donnes a retournerpublic abstract class Collector<R> extends Object
Collector.CollectorVisitor
) et de collecter des donnees pendant le parcours.
La classe a un type qui est le type de retour de la methode
detect(TopiaEntity...)
.
On peut donc très facilement en faire un collecteur de donnees.Modifier and Type | Class and Description |
---|---|
static class |
Collector.CollectorVisitor |
Modifier and Type | Field and Description |
---|---|
protected TopiaEntityEnum[] |
contracts
la liste des contracts des entites connues.
|
protected Collector.CollectorVisitor |
visitor
le visiteur utiliser pour trouver les types
|
Constructor and Description |
---|
Collector(Collector.CollectorVisitor visitor,
TopiaEntityEnum[] contracts) |
Collector(TopiaEntityEnum[] contracts) |
Modifier and Type | Method and Description |
---|---|
protected void |
after(Collector.CollectorVisitor visitor,
TopiaEntity entity) |
protected abstract R |
afterAll(Collector.CollectorVisitor visitor,
TopiaEntity... entities) |
protected void |
before(Collector.CollectorVisitor visitor,
TopiaEntity entity) |
protected void |
beforeAll(Collector.CollectorVisitor visitor,
TopiaEntity... entities) |
protected void |
clear() |
R |
detect(TopiaEntity... entities) |
protected void |
finalize() |
protected Collection<TopiaEntity> |
getAlreadyExplored() |
protected Class<? extends TopiaEntity> |
getContractClass(TopiaEntity e) |
protected Deque<TopiaEntity> |
getStack() |
protected TopiaEntity |
getTopiaValue(Object value) |
protected void |
onEnded(TopiaEntity e,
boolean enter) |
protected boolean |
onEnding(TopiaEntity e) |
protected void |
onStarted(TopiaEntity e,
boolean enter) |
protected boolean |
onStarting(TopiaEntity e) |
protected void |
onVisited(TopiaEntity e,
String name,
Class<?> collectionType,
Class<?> type,
int index,
Object value,
boolean enter) |
protected void |
onVisited(TopiaEntity e,
String name,
Class<?> collectionType,
Class<?> type,
Object value,
boolean enter) |
protected void |
onVisited(TopiaEntity e,
String name,
Class<?> type,
Object value,
boolean enter) |
protected boolean |
onVisiting(TopiaEntity e,
String name,
Class<?> collectionType,
Class<?> type,
int index,
Object value) |
protected boolean |
onVisiting(TopiaEntity e,
String name,
Class<?> collectionType,
Class<?> type,
Object value) |
protected boolean |
onVisiting(TopiaEntity e,
String name,
Class<?> type,
Object value) |
protected int |
stackSize() |
protected Collector.CollectorVisitor visitor
protected TopiaEntityEnum[] contracts
public Collector(Collector.CollectorVisitor visitor, TopiaEntityEnum[] contracts)
public Collector(TopiaEntityEnum[] contracts)
protected void clear()
protected boolean onStarting(TopiaEntity e)
protected void onStarted(TopiaEntity e, boolean enter)
protected boolean onVisiting(TopiaEntity e, String name, Class<?> type, Object value)
protected void onVisited(TopiaEntity e, String name, Class<?> type, Object value, boolean enter)
protected boolean onVisiting(TopiaEntity e, String name, Class<?> collectionType, Class<?> type, Object value)
protected void onVisited(TopiaEntity e, String name, Class<?> collectionType, Class<?> type, Object value, boolean enter)
protected boolean onVisiting(TopiaEntity e, String name, Class<?> collectionType, Class<?> type, int index, Object value)
protected void onVisited(TopiaEntity e, String name, Class<?> collectionType, Class<?> type, int index, Object value, boolean enter)
protected boolean onEnding(TopiaEntity e)
protected void onEnded(TopiaEntity e, boolean enter)
protected void beforeAll(Collector.CollectorVisitor visitor, TopiaEntity... entities)
protected void before(Collector.CollectorVisitor visitor, TopiaEntity entity)
protected void after(Collector.CollectorVisitor visitor, TopiaEntity entity)
protected abstract R afterAll(Collector.CollectorVisitor visitor, TopiaEntity... entities)
public R detect(TopiaEntity... entities) throws TopiaException
TopiaException
protected int stackSize()
protected Deque<TopiaEntity> getStack()
protected Collection<TopiaEntity> getAlreadyExplored()
protected void finalize() throws Throwable
protected Class<? extends TopiaEntity> getContractClass(TopiaEntity e)
protected TopiaEntity getTopiaValue(Object value)
Copyright © 2004–2022 Code Lutin. All rights reserved.