I - The type of the index value that is being used.H - The type of the concrete SUBCLASS that extends this class.public abstract class AExtVisitorHost<I,H extends IExtVisitorHost<I,? extends H>> extends java.lang.Object implements IExtVisitorHost<I,H>
public class MyExtVisitorHost extends AExtVisitorHost<MyIndex, MyExtVisitorHost> {...}
| Modifier and Type | Field and Description |
|---|---|
private I |
idx
The index value that is associated with this host object
|
private static long |
serialVersionUID |
| Constructor and Description |
|---|
AExtVisitorHost(I idx)
Constructor for the class.
|
| Modifier and Type | Method and Description |
|---|---|
<R,P> R |
execute(IExtVisitor<R,I,P,? extends H> algo,
P... params)
"Accept" method of the visitor design pattern that executes a given extended visitor by calling the associated
indexed case of the visitor.
|
private static final long serialVersionUID
private I idx
public AExtVisitorHost(I idx)
idx - The index value that is associated with this host objectpublic <R,P> R execute(IExtVisitor<R,I,P,? extends H> algo, P... params)
execute in interface IExtVisitorHost<I,H extends IExtVisitorHost<I,? extends H>>R - The return type of the visitor.P - The type of the input parameters of the visitor.algo - The extended visitor to run, which must use the same index type as this host, and be able to run on a sub-class of this host.params - Vararg input parameter to be used by the visitor.