Code example for ConcurrentSkipListSet

0
 * user-agents) 
 */ 
public class RobotsDirectives implements Serializable {
    private static final long serialVersionUID = 5386542759286155383L;
     
    ConcurrentSkipListSet<String> disallows = new ConcurrentSkipListSet<String>();
    ConcurrentSkipListSet<String> allows = new ConcurrentSkipListSet<String>();
    float crawlDelay = -1; 
 
    public boolean allows(String path) {
        return !(longestPrefixLength(disallows, path) > longestPrefixLength(allows, path));
    } 
 
    /** 
     * @param prefixSet 
     * @param str 
     * @return length of longest entry in {@code prefixSet} that prefixes {@code str}, or zero 
     *         if no entry prefixes {@code str} 
     */ 
    protected int longestPrefixLength(ConcurrentSkipListSet<String> prefixSet,
            String str) {