capacity() public method

public capacity ( ) : long
return long
示例#1
0
文件: Range.cs 项目: Mzazvor/fantom
        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);
        }
示例#2
0
文件: Range.cs 项目: nomit007/f4
 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;
 }