Package org.archive.surt

Examples of org.archive.surt.NewSurtTokenizer


     * @return
     */
    public Rule getMatchingRule(String surt, Date captureDate,
            Date retrievalDate, String who) {

        NewSurtTokenizer tok = new NewSurtTokenizer(surt);

        for (String key: tok.getSearchList()) {
            Iterable<Rule> rules = rulemap.get(key);
            if (rules != null) {
                for (Rule rule : rules) {
                    if (rule.matches(surt, captureDate, retrievalDate, who)) {
                        return rule;
View Full Code Here


       
        // add the root SURT
        rules.addAll(getRulesWithExactSurt("("));
       
        boolean first = true;
        for (String search: new NewSurtTokenizer(surt).getSearchList()) {
            if (first) {
                first = false;
                rules.addAll(getRulesWithSurtPrefix(search));
            } else {
                rules.addAll(getRulesWithExactSurt(search));
View Full Code Here

   
    protected ModelAndView ruleList(String surt, Long editingRuleId, HttpServletRequest request,
            HttpServletResponse response) throws Exception {
       
        surt = cleanSurt(surt);       
        int surtSegments = new NewSurtTokenizer(surt).toList().size();
        Map<String, Object> model = new HashMap<String, Object>();
        RuleSet rules = ruleDao.getRuleTree(surt);
        ArrayList<DisplayRule> ruleList = new ArrayList<DisplayRule>();
        ArrayList<String> childSurts = new ArrayList<String>();
       
        for (Rule rule: rules) {
            int comparison = rule.getSurt().compareTo(surt);
            if (comparison <= 0) {
                DisplayRule displayRule = new DisplayRule(rule, comparison != 0);
                displayRule.setEditing(rule.getId().equals(editingRuleId));
                ruleList.add(displayRule);
            } else {
                try {
                String segment = new NewSurtTokenizer(rule.getSurt())
                            .toList().get(surtSegments);
                    if (!childSurts.contains(segment)) {
                        childSurts.add(segment);
                    }
                } catch (IndexOutOfBoundsException e) {
View Full Code Here

     * @return
     */
    public static List<SurtNode> nodesFromSurt(String surt) {
        List<SurtNode> list = new ArrayList<SurtNode>();
        String running = "";
        for (String token: new NewSurtTokenizer(surt)) {
            running += token;
            list.add(new SurtNode(token, running));
        }
        return list;
    }
View Full Code Here

TOP

Related Classes of org.archive.surt.NewSurtTokenizer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.