I’m exposing an enumeration as a guide for traversing a tree-structure in preorder (an iterator uses these enum constants to decide how to traverse the tree):
/**
* The result type of an {@link IVisitor} implementation.
*
* @author Johannes Lichtenberger, University of Konstanz
*/
public enum EVisitResult {
/** Continue without visiting the siblings of this node. */
SKIPSIBLINGS,
/** Continue without visiting the descendants of this node. */
SKIPSUBTREE,
/** Continue traversal. */
CONTINUE,
/** Terminate traversal. */
TERMINATE,
/** Pop from the right sibling stack. */
SKIPSUBTREEPOPSTACK
}
However the last enum constant is only used for an internal visitor and shouldn’t ever be used from a user using the public API. Any ideas how I can hide “SKIPSUBTREEPOPSTACK”?
All you can do is document that it shouldn’t be used.
An alternative is to use an interface