Package cli.System.Collections

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


            String dir = Path.GetDirectoryName(arg);
            if(dir == "")
            {
                dir = null;
            }
            ArrayList list = new ArrayList();
            for(FileSystemInfo fsi : new DirectoryInfo(dir == null ? Environment.get_CurrentDirectory() : dir).GetFileSystemInfos(Path.GetFileName(arg)))
            {
                list.Add(dir != null ? Path.Combine(dir, fsi.get_Name()) : fsi.get_Name());
            }
            if(list.get_Count() == 0)
            {
                return new String[] { arg };
            }
            return (String[])(Object)list.ToArray(Type.GetType("System.String"));
        }
        catch(Throwable _)
        {
            return new String[] { arg };
        }
View Full Code Here

            System.arraycopy(args, skip, vmargs, 0, args.length - skip);
            return vmargs;
        }
        else
        {
            ArrayList list = new ArrayList();
            String cmdline = Environment.get_CommandLine();
            StringBuilder sb = new StringBuilder();
            for(int i = 0; i < cmdline.length(); )
            {
                boolean quoted = cmdline.charAt(i) == '"';
                for(;;)
                {
                    while(i < cmdline.length() && cmdline.charAt(i) != ' ' && cmdline.charAt(i) != '"')
                    {
                        sb.Append(cmdline.charAt(i++));
                    }
                    if(i < cmdline.length() && cmdline.charAt(i) == '"')
                    {
                        if(quoted && i > 1 && cmdline.charAt(i - 1) == '"')
                        {
                            sb.Append('"');
                        }
                        i++;
                        while(i < cmdline.length() && cmdline.charAt(i) != '"')
                        {
                            sb.Append(cmdline.charAt(i++));
                        }
                        if(i < cmdline.length() && cmdline.charAt(i) == '"')
                        {
                            i++;
                        }
                        if(i < cmdline.length() && cmdline.charAt(i) != ' ')
                        {
                            continue;
                        }
                    }
                    break;
                }
                while(i < cmdline.length() && cmdline.charAt(i) == ' ')
                {
                    i++;
                }
                if(skip > 0)
                {
                    skip--;
                }
                else
                {
                    if(quoted)
                    {
                        list.Add(sb.ToString());
                    }
                    else
                    {
                        list.AddRange((ICollection)(Object)glob(sb.ToString()));
                    }
                }
                sb.set_Length(0);
            }
            return (String[])(Object)list.ToArray(Type.GetType("System.String"));
        }
    }
View Full Code Here

TOP

Related Classes of cli.System.Collections.ArrayList

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.