Package org.apache.mahout.math.function

Examples of org.apache.mahout.math.function.IntProcedure


   *                  continues.
   * @return <tt>false</tt> if the procedure stopped before all keys where iterated over, <tt>true</tt> otherwise.
   */
  public boolean forEachPair(final IntShortProcedure procedure) {
    return forEachKey(
        new IntProcedure() {
          @Override
          public boolean apply(int key) {
            return procedure.apply(key, get(key));
          }
        }
View Full Code Here


   * @param list the list to be filled, can have any size.
   */
  public void keys(final IntArrayList list) {
    list.clear();
    forEachKey(
        new IntProcedure() {
          @Override
          public boolean apply(int key) {
            list.add(key);
            return true;
          }
View Full Code Here

   * @param list the list to be filled, can have any size.
   */
  public void values(final ShortArrayList list) {
    list.clear();
    forEachKey(
        new IntProcedure() {
          @Override
          public boolean apply(int key) {
            list.add(get(key));
            return true;
          }
View Full Code Here

   *
   * @return <tt>true</tt> if the receiver contains the specified key.
   */
  public boolean containsKey(final int key) {
    return !forEachKey(
        new IntProcedure() {
          @Override
          public boolean apply(int iterKey) {
            return (key != iterKey);
          }
        }
View Full Code Here

   *                  continues.
   * @return <tt>false</tt> if the procedure stopped before all keys where iterated over, <tt>true</tt> otherwise.
   */
  public boolean forEachPair(final IntObjectProcedure<T> procedure) {
    return forEachKey(
        new IntProcedure() {
          @Override
          public boolean apply(int key) {
            return procedure.apply(key, get(key));
          }
        }
View Full Code Here

   * @param list the list to be filled, can have any size.
   */
  public void keys(final IntArrayList list) {
    list.clear();
    forEachKey(
        new IntProcedure() {
          @Override
          public boolean apply(int key) {
            list.add(key);
            return true;
          }
View Full Code Here

   * @param list the list to be filled, can have any size.
   */
  public void values(final List<T> list) {
    list.clear();
    forEachKey(
        new IntProcedure() {
          @Override
          public boolean apply(int key) {
            list.add(get(key));
            return true;
          }
View Full Code Here

   *
   * @return <tt>true</tt> if the receiver contains the specified key.
   */
  public boolean containsKey(final int key) {
    return !forEachKey(
        new IntProcedure() {
          @Override
          public boolean apply(int iterKey) {
            return (key != iterKey);
          }
        }
View Full Code Here

   *                  continues.
   * @return <tt>false</tt> if the procedure stopped before all keys where iterated over, <tt>true</tt> otherwise.
   */
  public boolean forEachPair(final IntLongProcedure procedure) {
    return forEachKey(
        new IntProcedure() {
          @Override
          public boolean apply(int key) {
            return procedure.apply(key, get(key));
          }
        }
View Full Code Here

   * @param list the list to be filled, can have any size.
   */
  public void keys(final IntArrayList list) {
    list.clear();
    forEachKey(
        new IntProcedure() {
          @Override
          public boolean apply(int key) {
            list.add(key);
            return true;
          }
View Full Code Here

TOP

Related Classes of org.apache.mahout.math.function.IntProcedure

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