Examples of ByteIntProcedure


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

    }

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

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

    }

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

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

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

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

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

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

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

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

    public void putAll(ByteIntMap map)
    {
        map.forEachKeyValue(new ByteIntProcedure()
        {
            public void value(byte key, int value)
            {
                ByteIntHashMap.this.put(key, value);
            }
View Full Code Here

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

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

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

      return false;
    }

    return
        forEachPair(
            new ByteIntProcedure() {
              @Override
              public boolean apply(byte key, int value) {
                return other.containsKey(key) && other.get(key) == value;
              }
            }
        )
            &&
            other.forEachPair(
                new ByteIntProcedure() {
                  @Override
                  public boolean apply(byte key, int value) {
                    return containsKey(key) && get(key) == value;
                  }
                }
View Full Code Here

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

                           final IntArrayList valueList) {
    keyList.clear();
    valueList.clear();

    forEachPair(
        new ByteIntProcedure() {
          @Override
          public boolean apply(byte key, int value) {
            if (condition.apply(key, value)) {
              keyList.add(key);
              valueList.add(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.