Package com.crawljax.core

Examples of com.crawljax.core.CandidateCrawlAction


                      clickOnce, this);

      for (CandidateElement candidateElement : candidateList) {
        for (String eventType : eventTypes) {
          if (eventType.equals(EventType.click.toString())) {
            candidateActions.add(new CandidateCrawlAction(candidateElement,
                    EventType.click));
          } else {
            if (eventType.equals(EventType.hover.toString())) {
              candidateActions.add(new CandidateCrawlAction(candidateElement,
                      EventType.hover));
            } else {
              LOGGER.warn("The Event Type: " + eventType + " is not supported.");
            }
          }
View Full Code Here


  public void filterCandidateActions(List<CandidateElement> candidateElements) {
    if (candidateActions == null) {
      return;
    }
    Iterator<CandidateCrawlAction> iter = candidateActions.iterator();
    CandidateCrawlAction currentAction;
    while (iter.hasNext()) {
      currentAction = iter.next();
      if (!candidateElements.contains(currentAction.getCandidateElement())) {
        iter.remove();
        LOGGER.info("filtered candidate action: " + currentAction.getEventType().name()
                + " on " + currentAction.getCandidateElement().getGeneralString());

      }
    }
  }
View Full Code Here

   *            the manager that can be used to remove a crawler from the queue.
   * @return the action that needs to be performed by the Crawler.
   */
  public CandidateCrawlAction pollCandidateCrawlAction(Crawler requestingCrawler,
          CrawlQueueManager manager) {
    CandidateCrawlAction action = registerdCandidateActions.remove(requestingCrawler);
    if (action != null) {
      workInProgressCandidateActions.put(requestingCrawler, action);
      return action;
    }
    action = workInProgressCandidateActions.get(requestingCrawler);
View Full Code Here

   * @param newCrawler
   *            the crawler that wants an assignment
   * @return true if the crawler has an assignment false otherwise.
   */
  public boolean registerCrawler(Crawler newCrawler) {
    CandidateCrawlAction action = candidateActions.pollLast();
    if (action == null) {
      return false;
    }
    registeredCrawlers.offerFirst(newCrawler);
    registerdCandidateActions.put(newCrawler, action);
View Full Code Here

   * @param crawler
   *            the crawler to register
   * @return true if the crawler is successfully registered
   */
  public boolean startWorking(Crawler crawler) {
    CandidateCrawlAction action = registerdCandidateActions.remove(crawler);
    registeredCrawlers.remove(crawler);
    if (action == null) {
      return false;
    } else {
      workInProgressCandidateActions.put(crawler, action);
View Full Code Here

                      clickOnce, this);

      for (CandidateElement candidateElement : candidateList) {
        for (String eventType : eventTypes) {
          if (eventType.equals(EventType.click.toString())) {
            candidateActions.add(new CandidateCrawlAction(candidateElement,
                    EventType.click));
          } else {
            if (eventType.equals(EventType.hover.toString())) {
              candidateActions.add(new CandidateCrawlAction(candidateElement,
                      EventType.hover));
            } else {
              LOGGER.warn("The Event Type: " + eventType + " is not supported.");
            }
          }
View Full Code Here

   *            the manager that can be used to remove a crawler from the queue.
   * @return the action that needs to be performed by the Crawler.
   */
  public CandidateCrawlAction pollCandidateCrawlAction(Crawler requestingCrawler,
          CrawlQueueManager manager) {
    CandidateCrawlAction action = registerdCandidateActions.remove(requestingCrawler);
    if (action != null) {
      workInProgressCandidateActions.put(requestingCrawler, action);
      return action;
    }
    action = workInProgressCandidateActions.get(requestingCrawler);
View Full Code Here

   * @param newCrawler
   *            the crawler that wants an assignment
   * @return true if the crawler has an assignment false otherwise.
   */
  public boolean registerCrawler(Crawler newCrawler) {
    CandidateCrawlAction action = candidateActions.pollLast();
    if (action == null) {
      return false;
    }
    registeredCrawlers.offerFirst(newCrawler);
    registerdCandidateActions.put(newCrawler, action);
View Full Code Here

   * @param crawler
   *            the crawler to register
   * @return true if the crawler is successfully registered
   */
  public boolean startWorking(Crawler crawler) {
    CandidateCrawlAction action = registerdCandidateActions.remove(crawler);
    registeredCrawlers.remove(crawler);
    if (action == null) {
      return false;
    } else {
      workInProgressCandidateActions.put(crawler, action);
View Full Code Here

                      clickOnce, this);

      for (CandidateElement candidateElement : candidateList) {
        for (String eventType : eventTypes) {
          if (eventType.equals(EventType.click.toString())) {
            candidateActions.add(new CandidateCrawlAction(candidateElement,
                    EventType.click));
          } else {
            if (eventType.equals(EventType.hover.toString())) {
              candidateActions.add(new CandidateCrawlAction(candidateElement,
                      EventType.hover));
            } else {
              LOGGER.warn("The Event Type: " + eventType + " is not supported.");
            }
          }
View Full Code Here

TOP

Related Classes of com.crawljax.core.CandidateCrawlAction

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.