Examples of trimToSize()


Examples of java.util.Vector.trimToSize()

      }
    }
       
    if (implementations.isEmpty())
      return null;
    implementations.trimToSize();

    return implementations;
  }

    private boolean getPersistentServiceImplementation( Class possibleModule)
View Full Code Here

Examples of java.util.Vector.trimToSize()

   */
  public void test_trimToSize() {
    // Test for method void java.util.Vector.trimToSize()
    Vector v = new Vector(10);
    v.addElement(new Object());
    v.trimToSize();
    assertEquals("Failed to trim capacity", 1, v.capacity());
  }

  protected Vector vectorClone(Vector s) {
    return (Vector) s.clone();
View Full Code Here

Examples of java.util.Vector.trimToSize()

     * @return the number of text lines in the TextArea
     */
    public int getLines() {
        int retVal;
        Vector v = getRowStrings();
        v.trimToSize();
        retVal = v.size();
        if (growByContent) {
            rows = Math.max(rows, retVal);
        }
        return retVal;
View Full Code Here

Examples of java.util.Vector.trimToSize()

     * @return the number of text lines in the TextArea
     */
    public int getLines(){
        int retVal;
        Vector v = getRowStrings();
        v.trimToSize();
        retVal = v.size();
        if(growByContent){
            rows = Math.max(rows, retVal);
        }
        return retVal;
View Full Code Here

Examples of javax.swing.DefaultListModel.trimToSize()

  {
    harness.checkPoint("trimToSize()");
    DefaultListModel m1 = new DefaultListModel();   
    m1.addElement("A");
    m1.addElement("B");
    m1.trimToSize();
    harness.check(m1.capacity(), 2);
   
    DefaultListModel m2 = new DefaultListModel();
    m2.trimToSize();
    harness.check(m2.capacity(), 0);
View Full Code Here

Examples of javax.swing.DefaultListModel.trimToSize()

    m1.addElement("B");
    m1.trimToSize();
    harness.check(m1.capacity(), 2);
   
    DefaultListModel m2 = new DefaultListModel();
    m2.trimToSize();
    harness.check(m2.capacity(), 0);
  }

}
View Full Code Here

Examples of net.rim.device.api.util.IntVector.trimToSize()

            }
            if (_order6.getSelectedIndex() != 0) {
                transportIdsVector.addElement(_order6.getSelectedIndex());
            }

            transportIdsVector.trimToSize();
            preferredTransports = transportIdsVector.getArray();
        }

        // Process disallowed transports
        final IntVector disallowedTransports = new IntVector();
View Full Code Here

Examples of org.apache.mahout.math.list.DoubleArrayList.trimToSize()

          indexList.setSize(s * 3 / 2);
          indexList.trimToSize();
          indexList.setSize(s);

          valueList.setSize(s * 3 / 2);
          valueList.trimToSize();
          valueList.setSize(s);
        }
      } else {
        values[i].setQuick(k, value);
      }
View Full Code Here

Examples of org.apache.mahout.math.list.IntArrayList.trimToSize()

        indexList.remove(k);
        valueList.remove(k);
        int s = indexList.size();
        if (s > 2 && s * 3 < indexList.elements().length) {
          indexList.setSize(s * 3 / 2);
          indexList.trimToSize();
          indexList.setSize(s);

          valueList.setSize(s * 3 / 2);
          valueList.trimToSize();
          valueList.setSize(s);
View Full Code Here

Examples of org.apache.mahout.math.list.IntArrayList.trimToSize()

    for (int i = 0; i < size; i++) {
      if (condition.apply(getQuick(i))) {
        matches.add(i);
      }
    }
    matches.trimToSize();
    return viewSelection(matches.elements());
  }

  /**
   * Construct and returns a new selection view.
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.