Examples of LongIntProcedure


Examples of cern.colt.function.LongIntProcedure

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

Examples of cern.colt.function.LongIntProcedure

  final AbstractLongIntMap other = (AbstractLongIntMap) obj;
  if (other.size() != size()) return false;

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

Examples of cern.colt.function.LongIntProcedure

*       returns <tt>Long.MIN_VALUE</tt> if no such key exists.
*/
public long keyOf(final int value) {
  final long[] foundKey = new long[1];
  boolean notFound = forEachPair(
    new LongIntProcedure() {
      public boolean apply(long iterKey, int iterValue) {
        boolean found = value == iterValue;
        if (found) foundKey[0] = iterKey;
        return !found;
      }
View Full Code Here

Examples of cern.colt.function.LongIntProcedure

public void pairsMatching(final LongIntProcedure condition, final LongArrayList keyList, final IntArrayList valueList) {
  keyList.clear();
  valueList.clear();
 
  forEachPair(
    new LongIntProcedure() {
      public boolean apply(long key, int value) {
        if (condition.apply(key,value)) {
          keyList.add(key);
          valueList.add(value);
        }
View Full Code Here

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

    }

    public LongHashBag(LongHashBag bag)
    {
        this.items = new LongIntHashMap(bag.sizeDistinct());
        bag.forEachWithOccurrences(new LongIntProcedure()
        {
            public void value(long item, int occurrences)
            {
                LongHashBag.this.addOccurrences(item, occurrences);
            }
View Full Code Here

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

    }

    public static LongHashBag newBag(LongBag source)
    {
        final LongHashBag result = new LongHashBag();
        source.forEachWithOccurrences(new LongIntProcedure()
        {
            public void value(long each, int occurrences)
            {
                result.addOccurrences(each, occurrences);
            }
View Full Code Here

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

            return false;
        }
        if (source instanceof LongBag)
        {
            LongBag otherBag = (LongBag) source;
            otherBag.forEachWithOccurrences(new LongIntProcedure()
            {
                public void value(long each, int occurrences)
                {
                    LongHashBag.this.addOccurrences(each, occurrences);
                }
View Full Code Here

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

        }
        int oldSize = this.size();
        if (source instanceof LongBag)
        {
            LongBag otherBag = (LongBag) source;
            otherBag.forEachWithOccurrences(new LongIntProcedure()
            {
                public void value(long each, int occurrences)
                {
                    int oldOccurrences = LongHashBag.this.items.removeKeyIfAbsent(each, 0);
                    LongHashBag.this.size -= oldOccurrences;
View Full Code Here

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

        return true;
    }

    public void forEach(final LongProcedure procedure)
    {
        this.items.forEachKeyValue(new LongIntProcedure()
        {
            public void value(long key, int occurrences)
            {
                for (int i = 0; i < occurrences; i++)
                {
View Full Code Here

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

    }

    public LongHashBag select(final LongPredicate predicate)
    {
        final LongHashBag result = new LongHashBag();
        this.forEachWithOccurrences(new LongIntProcedure()
        {
            public void value(long each, int occurrences)
            {
                if (predicate.accept(each))
                {
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.