Package java.util

Examples of java.util.ArrayList.trimToSize()


      } else if (dist == min) {
  nn.add(r);
      }
    }

    nn.trimToSize();
    return (Instance[]) nn.toArray(new Instance[0]);
  }

  /**
   * Build the OLM classifier, meaning that the rule bases
View Full Code Here


        while (it.hasNext()) {
            Object o = it.next();
            if (set.add(o))
                ulist.add(o);
        }
        ulist.trimToSize();
        return ulist;
    }

    private static final Map createOperations()
    {
View Full Code Here

    public SimpleSequence(TemplateCollectionModel tcm) throws TemplateModelException {
        ArrayList alist = new ArrayList();
        for (TemplateModelIterator it = tcm.iterator(); it.hasNext();) {
            alist.add(it.next());
        }
        alist.trimToSize();
        list = alist;
    }

    /**
     * Constructs an empty simple sequence using the specified object wrapper.
View Full Code Here

        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

                    "Trouble accessing remote event(s) - skipping", cnfe);
            }
        }

  // Compact the collection, if possible
  events.trimToSize();
        if (operationsLogger.isLoggable(Level.FINER)) {
      operationsLogger.exiting(mailboxSourceClass,
          "getNextBatchDo", events);
  }
        return events;
View Full Code Here

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

         }
         catch (UnsupportedOperationException good) {}
        
         try
         {
            fciArrayList.trimToSize();
            fail("trimToSize call did not fail");
         }
         catch (UnsupportedOperationException good) {}
      }
     
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

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

                    .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

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.