Examples of IntIntProcedure


Examples of com.gs.collections.api.block.procedure.primitive.IntIntProcedure

    @Override
    public int hashCode()
    {
        final Counter result = new Counter();
        this.forEachWithOccurrences(new IntIntProcedure()
        {
            public void value(int eachItem, int occurrences)
            {
                result.add(eachItem ^ occurrences);
            }
View Full Code Here

Examples of com.gs.collections.api.block.procedure.primitive.IntIntProcedure

    {
        final boolean[] firstItem = {true};
        try
        {
            appendable.append(start);
            this.items.forEachKeyValue(new IntIntProcedure()
            {
                public void value(int each, int occurrences)
                {
                    try
                    {
View Full Code Here

Examples of com.gs.collections.api.block.procedure.primitive.IntIntProcedure

    }

    public int count(final IntPredicate predicate)
    {
        final Counter result = new Counter();
        this.forEachWithOccurrences(new IntIntProcedure()
        {
            public void value(int each, int occurrences)
            {
                if (predicate.accept(each))
                {
View Full Code Here

Examples of com.gs.collections.api.block.procedure.primitive.IntIntProcedure

    }

    public <V> MutableBag<V> collect(final IntToObjectFunction<? extends V> function)
    {
        final HashBag<V> result = HashBag.newBag(this.items.size());
        this.forEachWithOccurrences(new IntIntProcedure()
        {
            public void value(int each, int occurrences)
            {
                result.addOccurrences(function.valueOf(each), occurrences);
            }
View Full Code Here

Examples of com.gs.collections.api.block.procedure.primitive.IntIntProcedure

    }

    public long sum()
    {
        final long[] result = {0L};
        this.forEachWithOccurrences(new IntIntProcedure()
        {
            public void value(int each, int occurrences)
            {
                result[0] += (long) each * occurrences;
            }
View Full Code Here

Examples of com.gs.collections.api.block.procedure.primitive.IntIntProcedure

    public int[] toArray()
    {
        final int[] array = new int[this.size()];
        final int[] index = {0};

        this.forEachWithOccurrences(new IntIntProcedure()
        {
            public void value(int each, int occurrences)
            {
                for (int i = 0; i < occurrences; i++)
                {
View Full Code Here

Examples of com.gs.collections.api.block.procedure.primitive.IntIntProcedure

    public void writeExternal(final ObjectOutput out) throws IOException
    {
        out.writeInt(this.items.size());
        try
        {
            this.items.forEachKeyValue(new IntIntProcedure()
            {
                public void value(int each, int occurrences)
                {
                    try
                    {
View Full Code Here

Examples of com.gs.collections.api.block.procedure.primitive.IntIntProcedure

        this.addKeyValueAtIndex(key, value, index);
    }

    public void putAll(IntIntMap map)
    {
        map.forEachKeyValue(new IntIntProcedure()
        {
            public void value(int key, int value)
            {
                IntIntHashMap.this.put(key, value);
            }
View Full Code Here

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

   *
   * @return <tt>true</tt> if the receiver contains the specified value.
   */
  public boolean containsValue(final int value) {
    return !forEachPair(
        new IntIntProcedure() {
          @Override
          public boolean apply(int iterKey, int iterValue) {
            return (value != iterValue);
          }
        }
View Full Code Here

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

      return false;
    }

    return
        forEachPair(
            new IntIntProcedure() {
              @Override
              public boolean apply(int key, int value) {
                return other.containsKey(key) && other.get(key) == value;
              }
            }
        )
            &&
            other.forEachPair(
                new IntIntProcedure() {
                  @Override
                  public boolean apply(int key, int value) {
                    return containsKey(key) && get(key) == value;
                  }
                }
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.