class SingleWildcardNode extends BasicTreeNode {

    @Override
    public boolean hasInterestIn(char value, SearchContext context) {
        if (value == '?' || value == '#') {
            // Ignore illegal character unless it is the last character.
            return context.has(ContextKey.LAST_CHARACTER);
        }

        if (context.has(ContextKey.LEVEL_REACHED)) {
            // Next URL level reached, so no longer interested.
            context.remove(ContextKey.LEVEL_REACHED);
            return false;
        }

        if (value == '/') {
            // Make a note that the end of a URL level has been reached.
            context.add(ContextKey.LEVEL_REACHED, Boolean.TRUE);
            return true;
        }

        return true;
    }

}