Examples of trimToSize()


Examples of java.util.ArrayList.trimToSize()

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

Examples of java.util.ArrayList.trimToSize()

    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

Examples of java.util.ArrayList.trimToSize()

              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

Examples of java.util.ArrayList.trimToSize()

                    .get(i) == objArray[i]);
        Vector v = new Vector();
        v.add("a");
        ArrayList al = new ArrayList(v);
        Iterator it = al.iterator();
        al.trimToSize();
        try {
            it.next();
            fail("should throw a ConcurrentModificationException");
        } catch (ConcurrentModificationException ioobe) {
            // expected
View Full Code Here

Examples of java.util.ArrayList.trimToSize()

          .get(i) == objArray[i]);
    Vector v = new Vector();
    v.add("a");
    ArrayList al = new ArrayList(v);
    Iterator it = al.iterator();
    al.trimToSize();
    try {
      it.next();
      fail("should throw a ConcurrentModificationException");
    } catch (ConcurrentModificationException ioobe) {
      // expected
View Full Code Here

Examples of java.util.ArrayList.trimToSize()

    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

Examples of java.util.ArrayList.trimToSize()

         }
         catch (UnsupportedOperationException good) {}
        
         try
         {
            fciArrayList.trimToSize();
            fail("trimToSize call did not fail");
         }
         catch (UnsupportedOperationException good) {}
      }
     
View Full Code Here

Examples of java.util.ArrayList.trimToSize()

         }
         catch (UnsupportedOperationException good) {}
        
         try
         {
            fciArrayList.trimToSize();
            fail("trimToSize call did not fail");
         }
         catch (UnsupportedOperationException good) {}
      }
     
View Full Code Here

Examples of java.util.ArrayList.trimToSize()

              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

Examples of java.util.ArrayList.trimToSize()

        if(expirationLogger.isLoggable(Level.FINEST)) {
            expirationLogger.log(Level.FINEST, "Iterator notified");
        }
       
  // Compact the collection, if possible
  events.trimToSize();
        if (operationsLogger.isLoggable(Level.FINER)) {
      operationsLogger.exiting(mailboxSourceClass,
          "getRemoteEventsDo", events);
  }
       
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.