Examples of LinkedList


Examples of java.util.LinkedList

  public QSAdminGUI getGUI(){
    return gui;
  }

  public void startSocketListener() {
    receivedMsg = new LinkedList();
    Thread t = new Thread() {
      public void run() {
        String rec = null;
        logger.info("Started");
        while(true) {

Examples of java.util.LinkedList

        return null;
    }

    public List getItemsForOMGraphicMenu(OMGraphic omg) {
        Debug.output("getMenuFor(" + omg.getClass().getName() + ")");
        List list = new LinkedList();
        list.add(new JMenuItem(omg.getClass().getName()));
        return list;
    }

Examples of java.util.LinkedList

//        } else { //permit to add multi-locks on same lock for same identity
//            Lock tmpLock = (Lock)treeid2lock.get(treeId);
//            if (tmpLock != lock)
//                throw new ChaiDBException(ErrorCode.ALERADY_EXIST_LOCK, "Already exit lock on this tree id");
//        }
        LinkedList locks = (LinkedList) treeid2lock.get(treeName);
        if (locks == null) {
            locks = new LinkedList();
            treeid2lock.put(treeName, locks);
        }
        locks.addFirst(lock);
    }

Examples of java.util.LinkedList

     *
     * @param treeName The tree id with which the lock list associate.
     * @return The lock list with which the tree id associates.
     */
    public Lock getLock(String treeName) throws ChaiDBException {
        LinkedList lock;
        if (treeid2lock.containsKey(treeName)) {
            lock = (LinkedList) treeid2lock.get(treeName);
            if (lock == null || lock.size() == 0)
                throw new ChaiDBException(ErrorCode.LOCK_NULL, "The lock is null in the entry which treeid is exist.");
            else {
                if (lock.size() == 1) {
                    removeLock(treeName);
                }
                return (Lock) lock.removeFirst();
            }
        } else {
            return null;
        }
    }

Examples of java.util.LinkedList

    try{
      this_mon.enter();
   
      DHTRouterNodeImpl  node = root;
     
      LinkedList  stack = new LinkedList();
     
      while( true ){
       
        List  buckets = node.getBuckets();
       
        if ( buckets == null ){
         
          if ( random.nextBoolean()){
           
            stack.add( node.getRight());

            node = node.getLeft();           
           
          }else{
           
            stack.add( node.getLeft());

            node = node.getRight();           
          }
        }else{
         
          int           max_fails       = 0;
          DHTRouterContactImpl  max_fails_contact  = null;
         
          for (int i=0;i<buckets.size();i++){
           
            DHTRouterContactImpl  contact = (DHTRouterContactImpl)buckets.get(i);

            if ( !contact.getPingOutstanding()){
             
              int  fails = contact.getFailCount();
             
              if ( fails > max_fails ){
               
                max_fails      = fails;
                max_fails_contact  = contact;
              }
            }
          }
         
          if ( max_fails_contact != null ){
                       
            requestPing( max_fails_contact );
           
            return;
          }
         
          if ( stack.size() == 0 ){
           
            break;
          }
         
          node = (DHTRouterNodeImpl)stack.removeLast();
        }
      }
    }finally{
     
      this_mon.exit();

Examples of java.util.LinkedList

  init()
  {
    pings    = new pingValue[max_pings];
    ping_count  = 0;
   
    regions  = new LinkedList();
   
    up_estimate    = getNullLimit();
    down_estimate  = getNullLimit();

    last_bad_ups    = new LinkedList();
    last_bad_downs    = new LinkedList();
   
    last_bad_up          = null;
    bad_up_in_progress_count  = 0;
   
    last_bad_down        = null;

Examples of java.util.LinkedList

  protected LinkedList
  loadLimits(
    Map    map,
    String  name )
  {
    LinkedList  result = new LinkedList();
   
    List  l = (List)map.get(name);
   
    if ( l != null ){
     
      for (int i=0;i<l.size();i++){
       
        Map m = (Map)l.get(i);
             
        result. add(loadLimit( m ));
      }
    }
   
    return( result );
  }

Examples of java.util.LinkedList

public class TimeTable
{
    private List children;
   
    private static List listFactory() {
      return new LinkedList();
    }

Examples of java.util.LinkedList

     * @param g
     * @param pts
     * @param reverse
     */
    protected void drawFollow(Graphics g, Point2D[] pts, boolean reverse) {
        LinkedList points = new LinkedList();
        if (reverse) {
            for (int i = pts.length - 1; i >= 0; i--)
                points.add(pts[i]);
        } else {
            for (int i = 0; i < pts.length; i++)
                points.add(pts[i]);
        }

        LinkedList polysegment = new LinkedList();
        int l, x1, y1, x2, y2;
        String c;
        Point2D p1, p2;
        double angle;
        for (int i = 0; i < text.length(); i++) {
            c = text.substring(i, i + 1);
            l = metrics.stringWidth(c);
            if (points.size() == 0)
                break;
            LineUtil.retrievePoints(l, points, polysegment);

            p1 = (Point2D) polysegment.getFirst();
            x1 = (int) p1.getX();
            y1 = (int) p1.getY();
            p2 = (Point2D) polysegment.getLast();
            x2 = (int) p2.getX();
            y2 = (int) p2.getY();

            angle = Math.atan2(y2 - y1, x2 - x1);
            drawAngledString(g, c, x1, y1, angle);

Examples of java.util.LinkedList

                    + timerIntervalFormatString);
        }

        String timerRatesString = properties.getProperty(prefix
                + TimerRatesProperty);
        timerRates = new LinkedList();
        if (timerRatesString != null) {
            if (Debug.debugging("scenario")) {
                Debug.output("ScenarioGraphicLoader reading timer rates: "
                        + timerRatesString);
            }
TOP
Copyright © 2018 www.massapi.com. 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.