Examples of ArrayList


Examples of cli.System.Collections.ArrayList

        {
            resetWakeupSocket();
            return 0;
        }

        ArrayList read = new ArrayList();
        ArrayList write = new ArrayList();
        ArrayList error = new ArrayList();
        for (int i = 0; i < channelArray.get_Count(); i++)
        {
            SelectionKeyImpl ski = (SelectionKeyImpl)channelArray.get_Item(i);
            int ops = ski.interestOps();
            if (ski.channel() instanceof SocketChannelImpl)
            {
                // TODO there's a race condition here...
                if (((SocketChannelImpl)ski.channel()).isConnected())
                {
                    ops &= SelectionKey.OP_READ | SelectionKey.OP_WRITE;
                }
                else
                {
                    ops &= SelectionKey.OP_CONNECT;
                }
            }
            if ((ops & (SelectionKey.OP_READ | SelectionKey.OP_ACCEPT)) != 0)
            {
                read.Add(ski.getSocket());
            }
            if ((ops & (SelectionKey.OP_WRITE | SelectionKey.OP_CONNECT)) != 0)
            {
                write.Add(ski.getSocket());
            }
            if ((ops & SelectionKey.OP_CONNECT) != 0)
            {
                error.Add(ski.getSocket());
            }
        }
        read.Add(wakeupSourceFd);
        try
        {
            begin();
            int microSeconds = 1000 * (int)Math.min(Integer.MAX_VALUE / 1000, timeout);
            try
            {
                if (false) throw new SocketException();
                // FXBUG docs say that -1 is infinite timeout, but that doesn't appear to work
                Socket.Select(read, write, error, timeout < 0 ? Integer.MAX_VALUE : microSeconds);
            }
            catch (SocketException _)
            {
                read.Clear();
                write.Clear();
                error.Clear();
            }
        }
        finally
        {
            end();
View Full Code Here

Examples of com.cumulocity.me.lang.ArrayList

        }
        return uri;
    }

    private List findDelta(Collection in, Collection from) {
        List delta = new ArrayList();
        Iterator fromIterator = from.iterator();
        while (fromIterator.hasNext()) {
            String p = (String) fromIterator.next();
            boolean found = false;
           
            Iterator inIterator = in.iterator();
            while (!found && inIterator.hasNext()) {
                found = p.equals((String) inIterator.next());
            }
           
            if (!found) {
                delta.add(p);
            }
        }
        return delta;
    }
View Full Code Here

Examples of flex.messaging.io.ArrayList

    Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
    con = DriverManager.getConnection("jdbc:sqlserver://127.0.0.1:1433;DatabaseName=test", user, psw);
    stmt2 = con.createStatement();
    rs = stmt2.executeQuery(str);
    ArrayList a = new ArrayList();   
    while(rs.next())
    {
      a.add(rs.getString(1));
    }   
    jsh = new String[a.size()];   
    for(int i = 0; i < a.size(); i++)
    {
      jsh[i]= (String)a.get(i);
    }
   
    //ѡ���Ͽΰ༶
    rs=stmt2.executeQuery("SELECT distinct bjm FROM course_list where xq='"+week+"' and js='"+js+"'");
    ArrayList a1 = new ArrayList();   
    while(rs.next())
    {
      a1.add(rs.getString(1));
    }   
    bjm = new String[a1.size()];   
    for(int i = 0; i < a1.size(); i++)
    {
      bjm[i]= (String)a1.get(i);
    }   

    iii=a.size();
    rs.close();
    rs.close();
    stmt2.close();
    con.close();
   
   
  }catch(SQLException e){
    e.printStackTrace();
  }
}else{
  iii=0;
}

if(time>=480&&time<=710||time>=780&&time<=1200){  //8:00-11:50��13:00-20:00��������Ϊ0-70
  for(int j=1;j<6;j++){               //i�������c����¥��j�����ѧ¥
     for(int c=1;c<6;c++){
       for(int i=1;i<11;i++){
         String lh=Integer.toString(j);
         String lc=Integer.toString(c);
        if(i>9)
          js1=Integer.toString(i);
        else
          js1="0"+Integer.toString(i);
        
         lon=lh+lc+js1;
        // System.out.print(lon+"  ");

         if(iii!=0){
           int pan=0;
           for(int k=0;k<iii;k++){
             if(lon.equals(jsh[k])){//�������Ͽεİ༶����Ϊ��120�����ϿΣ��ܹ���������һ���ϣ�ÿ����63�ˣ�
              try{
                Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
                con = DriverManager.getConnection("jdbc:sqlserver://127.0.0.1:1433;DatabaseName=test", user, psw);
                stmt2 = con.createStatement()
                //�����Ͽ�����
              rs=null;
              rs=stmt2.executeQuery("SELECT xh FROM [test].[dbo].[stu_info] where bjm='"+bjm[z].trim()+"' or bjm='"+bjm[z+1].trim()+"'");
              ArrayList a2 = new ArrayList();
              z=z+2;
              while(rs.next())
              {
                a2.add(rs.getString(1));
              }   
                renshu = a2.size()-6;
                //System.out.println("a2="+a2.size());            
              
               Element title= document.createElement("Class_num");
               root.appendChild(title);
View Full Code Here

Examples of jade.util.leap.ArrayList

        // Log the original error
        logger.log(Logger.SEVERE,"DB error during search operation.", sqle);
        try {invalidateConnectionWrapper();} catch(Exception e1) {}
      }
    }
    return new ArrayList();
  }
View Full Code Here

Examples of java.util.ArrayList

   */
  private List getMessages(int nb, String selector, boolean remove) {  
    if (logger.isLoggable(BasicLevel.DEBUG))
      logger.log(BasicLevel.DEBUG, "Queue.getMessages(" + nb + ',' + selector + ',' + remove + ')');

    List lsMessages = new ArrayList();
    Message message;
    int j = 0;
    // Checking the deliverable messages:
    while ((lsMessages.size() < nb || nb == -1) &&  j < messages.size()) {
      message = (Message) messages.get(j);

      // If selector matches, sending the message:
      if (Selector.matches(message.getHeaderMessage(), selector) &&
          checkDelivery(message.getHeaderMessage())) {
        message.incDeliveryCount();
        nbMsgsDeliverSinceCreation++;

        // use in sub class see ClusterQueue
        messageDelivered(message.getIdentifier());

        if (logger.isLoggable(BasicLevel.DEBUG))
          logger.log(BasicLevel.DEBUG, "Message " + message.getIdentifier());

        lsMessages.add(message);

        if (remove) {
          messages.remove(message);
          message.delete();
        } else {
View Full Code Here

Examples of java.util.ArrayList

       
        joinNode.setProperty(joinNode.getFirstChild() == childNode ? NodeConstants.Info.SORT_LEFT : NodeConstants.Info.SORT_RIGHT, SortOption.SORT);
       
        if (needsCorrection) {
            PlanNode projectNode = NodeFactory.getNewNode(NodeConstants.Types.PROJECT);
            projectNode.setProperty(NodeConstants.Info.PROJECT_COLS, new ArrayList(outputSymbols));
            childNode.addAsParent(projectNode);
            correctOutputElements(joinNode, outputSymbols, projectNode);
        }       
        return false;
    }
View Full Code Here

Examples of java.util.ArrayList

    private static PlanNode createSortNode(List<SingleElementSymbol> orderSymbols,
                                           Collection outputElements) {
        PlanNode sortNode = NodeFactory.getNewNode(NodeConstants.Types.SORT);
        sortNode.setProperty(NodeConstants.Info.SORT_ORDER, new OrderBy(orderSymbols));
        sortNode.setProperty(NodeConstants.Info.OUTPUT_COLS, new ArrayList(outputElements));
        return sortNode;
    }
View Full Code Here

Examples of java.util.ArrayList

    private static void correctOutputElements(PlanNode endNode,
                                              Collection outputElements,
                                              PlanNode startNode) {
        while (startNode != endNode) {
            startNode.setProperty(NodeConstants.Info.OUTPUT_COLS, new ArrayList(outputElements));
            startNode = startNode.getParent();
        }
    }
View Full Code Here

Examples of java.util.ArrayList

public class TestJoinRegion extends TestCase {
   
    public void testFindJoinRegions() {
       
        List regions = new ArrayList();
       
        PlanNode joinRoot = TestFrameUtil.getExamplePlan();
       
        PlanNode joinRoot1 = TestFrameUtil.getExamplePlan();
       
        PlanNode outerJoin = NodeFactory.getNewNode(NodeConstants.Types.JOIN);
       
        outerJoin.setProperty(NodeConstants.Info.JOIN_TYPE, JoinType.JOIN_LEFT_OUTER);
       
        outerJoin.addFirstChild(joinRoot);
        outerJoin.addFirstChild(joinRoot1);
       
        PlanNode source = NodeFactory.getNewNode(NodeConstants.Types.SOURCE);
       
        source.addFirstChild(outerJoin);
       
        RulePlanJoins.findJoinRegions(source, null, regions);
       
        assertEquals(3, regions.size());
       
        JoinRegion region = (JoinRegion)regions.get(0);
       
        //ensure that the first region is the trivial region of the outer join
        assertEquals(1, region.getJoinSourceNodes().size());
    }
View Full Code Here

Examples of java.util.ArrayList

        assertEquals(1, region.getJoinSourceNodes().size());
    }

    public void testReconstruction() {
       
        List regions = new ArrayList();
       
        PlanNode joinRoot = TestFrameUtil.getExamplePlan();
       
        PlanNode source = NodeFactory.getNewNode(NodeConstants.Types.SOURCE);
       
        source.addFirstChild(joinRoot);
       
        RulePlanJoins.findJoinRegions(source, null, regions);
       
        assertEquals(1, regions.size());
       
        JoinRegion region = (JoinRegion)regions.get(0);
       
        assertEquals(3, region.getJoinSourceNodes().size());
       
        assertEquals(joinRoot, region.getJoinRoot());
       
View Full Code Here
TOP
Copyright © 2015 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.