class TransclusionDecideRule extends PredicatedDecideRule {

    private static final long serialVersionUID = -3975688876990558918L;

    {
        setMaxTransHops(2);
    }
    public int getMaxTransHops() {
        return (Integer) kp.get("maxTransHops");
    }
    /**
     * Maximum number of non-navlink (non-'L') hops to ACCEPT.
     */
    public void setMaxTransHops(int maxTransHops) {
        kp.put("maxTransHops", maxTransHops);
    }
    
    {
        setMaxSpeculativeHops(1);
    }
    public int getMaxSpeculativeHops() {
        return (Integer) kp.get("maxSpeculativeHops");
    }
    /**
     * Maximum number of speculative ('X') hops to ACCEPT.
     */
    public void setMaxSpeculativeHops(int maxSpeculativeHops) {
        kp.put("maxSpeculativeHops", maxSpeculativeHops);
    }

    /**
     * Usual constructor. 
     */
    public TransclusionDecideRule() {
    }

    /**
     * Evaluate whether given object is within the acceptable thresholds of
     * transitive hops.
     * 
     * @param curi CrawlURI to make decision on.
     * @return true if the transitive hops &gt;0 and &lt;= max
     */
    protected boolean evaluate(CrawlURI curi) {<FILL_FUNCTION_BODY>}


}

        String hopsPath = curi.getPathFromSeed();
        if (hopsPath == null || hopsPath.length() == 0) {
            return false; 
        }
        int allCount = 0;
        int nonrefCount = 0; 
        int specCount = 0; 
        for (int i = hopsPath.length() - 1; i >= 0; i--) {
            char c = hopsPath.charAt(i);
            if (c == Hop.NAVLINK.getHopChar() || c == Hop.SUBMIT.getHopChar() || c == Hop.MANIFEST.getHopChar()) {
                // end of hops counted here
                break;
            } 
            allCount++; 
            if (c != Hop.REFER.getHopChar()) {
                nonrefCount++;
            }
            if (c == Hop.SPECULATIVE.getHopChar()) {
                specCount++;
            }
        }
        // transclusion doesn't apply if there isn't at least one non-nav-hop
        if (allCount <= 0) {
            return false;
        }
        
        // too many speculative hops disqualify from transclusion
        if (specCount > getMaxSpeculativeHops()) {
            return false;
        }
        
        // transclusion applies as long as non-ref hops less than max
        return nonrefCount <= getMaxTransHops();
    
<methods>public void <init>() ,public org.archive.modules.deciderules.DecideResult getDecision() ,public org.archive.modules.deciderules.DecideResult onlyDecision(org.archive.modules.CrawlURI) ,public void setDecision(org.archive.modules.deciderules.DecideResult) <variables>private static final long serialVersionUID