capacity() public method

public capacity ( ) : long
return long
Beispiel #1
0
        public List toList()
        {
            int  start = (int)m_start;
            int  end   = (int)m_end;
            List acc   = new List(Sys.IntType);

            if (start < end)
            {
                if (m_exclusive)
                {
                    --end;
                }
                acc.capacity(end - start + 1);
                for (int i = start; i <= end; ++i)
                {
                    acc.add(Long.valueOf(i));
                }
            }
            else
            {
                if (m_exclusive)
                {
                    ++end;
                }
                acc.capacity(start - end + 1);
                for (int i = start; i >= end; --i)
                {
                    acc.add(Long.valueOf(i));
                }
            }
            return(acc);
        }
Beispiel #2
0
 public List toList()
 {
     int start = (int)m_start;
       int end = (int)m_end;
       List acc = new List(Sys.IntType);
       if (start < end)
       {
     if (m_exclusive) --end;
     acc.capacity(end-start+1);
     for (int i=start; i<=end; ++i)
       acc.add(Long.valueOf(i));
       }
       else
       {
     if (m_exclusive) ++end;
     acc.capacity(start-end+1);
     for (int i=start; i>=end; --i)
       acc.add(Long.valueOf(i));
       }
       return acc;
 }