Package java.util

Examples of java.util.Vector$Itr


       @param sender The sender of the message
       @param seqno The sequence number associated with the message
       @return boolean If false, message is already present. Otherwise true.
     */
    public boolean add(Object sender, long seqno) {
    Vector seqnos=(Vector)msgs.get(sender);
    Long   val=new Long(seqno);

    if(seqnos == null) {
        seqnos=new Vector();
        seqnos.addElement(val);
        msgs.put(sender, seqnos);
        return true;
    }

    if(seqnos.contains(val))
        return false;

    seqnos.addElement(val);
    return true;
    }
View Full Code Here





    public void remove(Object sender, Vector seqnos) {
    Vector v=(Vector)msgs.get(sender);
    Long   seqno;

    if(v != null && seqnos != null) {
        for(int i=0; i < seqnos.size(); i++) {
        seqno=(Long)seqnos.elementAt(i);
        v.removeElement(seqno);
        }
    }
    }
View Full Code Here

        win.add(sender1, 8);

        System.out.println(win);


        Vector seqnos=new Vector();

        seqnos.addElement(new Long(4));
        seqnos.addElement(new Long(6));
        seqnos.addElement(new Long(8));

        win.remove(sender2, seqnos);
        System.out.println(win);

        win.remove(sender1, seqnos);
View Full Code Here

                cSteps);
    }
   
    public void push(Gray8Image im) throws Error {
        byte[] bData = im.getData();
        Vector points = new Vector();
        for (int i=0; i<im.getHeight(); i++) {
            for (int j=0; j<im.getWidth(); j++) {
                if (bData[i*im.getWidth()+j] != Byte.MIN_VALUE) {
                    points.addElement(new Point(i,j));
                }
            }
        }
        this.hough.push(points);
    }
View Full Code Here

   */
  public void initialize(boolean firstTime) {
    cleanWaitingRequest(System.currentTimeMillis());

    receiving = false;
    messages = new Vector();
    deliveredMsgs = new Hashtable();

    if (firstTime) return;

    // Retrieving the persisted messages, if any.
View Full Code Here

    try {
      // Creating a statement lets us issue commands against the connection.
      Statement s = conn.createStatement();
      ResultSet rs = s.executeQuery("SELECT name FROM JoramDB WHERE name LIKE '" + prefix + "%'");

      Vector v = new Vector();
      while (rs.next()) {
        v.add(rs.getString(1));
      }
      rs.close();
      s.close();

      String[] result = new String[v.size()];
      result = (String[]) v.toArray(result);

      return result;
    } catch (SQLException sqle) {
      if (sqle instanceof com.mysql.jdbc.CommunicationsException && !reconnectLoop) {
          logger.log(BasicLevel.WARN, "Database reconnection problem at list, Reconnecting");
View Full Code Here

        String realPath = servlet.getServletContext().getRealPath("/");
        File resources = new File(realPath,ResourceServlet.relativePath);
        File tresources = new File(resources,path);
       
        File[] files = tresources.listFiles();
        Vector mfiles = new Vector();
        for( int i=0; i<files.length; i++ ) {
          mfiles.add(new org.nextime.ion.backoffice.bean.File(files[i]));
        }
       
        request.setAttribute("files",mfiles);
       
        // Forward to the next page
View Full Code Here

  }

  public Vector getPublicationTypes() {
    try {
      if (_publicationsTypes.contains("*")) {
        Vector r = new Vector();
        Vector rt = TypePublication.listAll();
        for (int i = 0; i < rt.size(); i++) {
          r.add(((TypePublication) rt.get(i)).getId());
        }
        return r;
      }
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

    TreeControlNode root = treeControl.getRoot();

    try {
      Mapping.begin();
      Vector roots = Section.listRootSections();
      for (int i = 0; i < roots.size(); i++) {
        Section section = (Section) roots.get(i);
        TreeControlNode node = buildNode(section);
        //if( i==0 ) treeControl.selectNode(section.getId());
        root.addChild(node);
        recursive(section, node);
      }
View Full Code Here

        false);
    return node;
  }

  private void recursive(Section section, TreeControlNode node) {
    Vector childs = section.listSubSections();
    for (int i = 0; i < childs.size(); i++) {
      Section tsection = (Section) childs.get(i);
      TreeControlNode tnode = buildNode(tsection);
      node.addChild(tnode);
      recursive(tsection, tnode);
    }
  }
View Full Code Here

TOP

Related Classes of java.util.Vector$Itr

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.