capacity() public méthode

public capacity ( ) : long
Résultat long
Exemple #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);
        }
Exemple #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;
 }