Package java.util

Examples of java.util.ArrayList.trimToSize()


                    else
                        minCapacity--;
                }
            }
            StringBuffer outputStringBuffer = new StringBuffer();
            outputArrayList.trimToSize();
            Object[] outputObj = outputArrayList.toArray();
            outputStr = new String[outputArrayList.size()];
            for (int j=0; j<outputArrayList.size(); j++)
            {
                outputStr[j] = new String((String) outputObj[j]);
View Full Code Here


                    minCapacity--;
            }
           
        }
       
        outputArrayList.trimToSize();
        Object[] outputObj = outputArrayList.toArray();
        String[] outputStr = new String[outputArrayList.size()];
        for (int i=0; i<outputArrayList.size(); i++)
            outputStr[i] = new String((String) outputObj[i]);
        return outputStr;
View Full Code Here

    public void trimToSize() {

        if (fast) {
            synchronized (this) {
                ArrayList temp = (ArrayList) list.clone();
                temp.trimToSize();
                list = temp;
            }
        } else {
            synchronized (list) {
                list.trimToSize();
View Full Code Here

    parent = parent.getParent();
    if (parent == null) {
      return null;
    }
  }
  parents.trimToSize();
  return parents;
}
public CompilationUnit getCompilationUnitAST() {
  return this.ast;
}
View Full Code Here

  IJavaElement parent = element.getParent();
  while (parent != null) {
    parents.add(parent);
    parent = parent.getParent();
  }
  parents.trimToSize();
  return parents;
}
/**
* @see IRegion
*/
 
View Full Code Here

    Iterator localIterator = backingMap().values().iterator();
    while (localIterator.hasNext())
    {
      Collection localCollection = (Collection)localIterator.next();
      ArrayList localArrayList = (ArrayList)localCollection;
      localArrayList.trimToSize();
    }
  }

  @GwtIncompatible("java.io.ObjectOutputStream")
  private void writeObject(ObjectOutputStream paramObjectOutputStream)
View Full Code Here

        ArrayList al = new ArrayList();
        StringTokenizer st = new StringTokenizer(cp, pathSep);
        while (st.hasMoreTokens()) {
            al.add(st.nextToken());
        }
        al.trimToSize();
        return al;
    }

    public List classPath() {
        return getPath("java.class.path");
View Full Code Here

    public void trimToSize() {

        if (fast) {
            synchronized (this) {
                ArrayList temp = (ArrayList) list.clone();
                temp.trimToSize();
                list = temp;
            }
        } else {
            synchronized (list) {
                list.trimToSize();
View Full Code Here

        ArrayList al = new ArrayList();
        StringTokenizer st = new StringTokenizer(cp, pathSep);
        while (st.hasMoreTokens()) {
            al.add(st.nextToken());
        }
        al.trimToSize();
        return al;
    }

    public List classPath() {
        return getPath("java.class.path");
View Full Code Here

              NamingEnumeration attributeValues = attribute.getAll();
              while (attributeValues.hasMore()) {
                  Object attrValue = attributeValues.next();
                  attributeValueList.add(getHeaderValueAsString(attrValue));
              }
              attributeValueList.trimToSize(); // should be a no-op if attribute.size() didn't lie
              headerFields.put(attributeID, Collections.unmodifiableList(attributeValueList));
          }
      } catch (NamingException ne) {
            // Shouldn't happen
      }
View Full Code Here

TOP
Copyright © 2018 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.