Package org.apache.commons.lang3.mutable

Examples of org.apache.commons.lang3.mutable.MutableInt


            return clone(array);
        }
        final HashMap<Integer, MutableInt> occurrences = new HashMap<Integer, MutableInt>(values.length);
        for (final int v : values) {
            final Integer boxed = Integer.valueOf(v);
            final MutableInt count = occurrences.get(boxed);
            if (count == null) {
                occurrences.put(boxed, new MutableInt(1));
            } else {
                count.increment();
            }
        }
        final BitSet toRemove = new BitSet();
        for (final Map.Entry<Integer, MutableInt> e : occurrences.entrySet()) {
            final Integer v = e.getKey();
View Full Code Here


            return clone(array);
        }
        final HashMap<Character, MutableInt> occurrences = new HashMap<Character, MutableInt>(values.length);
        for (final char v : values) {
            final Character boxed = Character.valueOf(v);
            final MutableInt count = occurrences.get(boxed);
            if (count == null) {
                occurrences.put(boxed, new MutableInt(1));
            } else {
                count.increment();
            }
        }
        final BitSet toRemove = new BitSet();
        for (final Map.Entry<Character, MutableInt> e : occurrences.entrySet()) {
            final Character v = e.getKey();
View Full Code Here

            return clone(array);
        }
        final HashMap<Long, MutableInt> occurrences = new HashMap<Long, MutableInt>(values.length);
        for (final long v : values) {
            final Long boxed = Long.valueOf(v);
            final MutableInt count = occurrences.get(boxed);
            if (count == null) {
                occurrences.put(boxed, new MutableInt(1));
            } else {
                count.increment();
            }
        }
        final BitSet toRemove = new BitSet();
        for (final Map.Entry<Long, MutableInt> e : occurrences.entrySet()) {
            final Long v = e.getKey();
View Full Code Here

            return clone(array);
        }
        final HashMap<Float, MutableInt> occurrences = new HashMap<Float, MutableInt>(values.length);
        for (final float v : values) {
            final Float boxed = Float.valueOf(v);
            final MutableInt count = occurrences.get(boxed);
            if (count == null) {
                occurrences.put(boxed, new MutableInt(1));
            } else {
                count.increment();
            }
        }
        final BitSet toRemove = new BitSet();
        for (final Map.Entry<Float, MutableInt> e : occurrences.entrySet()) {
            final Float v = e.getKey();
View Full Code Here

            return clone(array);
        }
        final HashMap<Double, MutableInt> occurrences = new HashMap<Double, MutableInt>(values.length);
        for (final double v : values) {
            final Double boxed = Double.valueOf(v);
            final MutableInt count = occurrences.get(boxed);
            if (count == null) {
                occurrences.put(boxed, new MutableInt(1));
            } else {
                count.increment();
            }
        }
        final BitSet toRemove = new BitSet();
        for (final Map.Entry<Double, MutableInt> e : occurrences.entrySet()) {
            final Double v = e.getKey();
View Full Code Here

            return clone(array);
        }
        final HashMap<Boolean, MutableInt> occurrences = new HashMap<Boolean, MutableInt>(2); // only two possible values here
        for (final boolean v : values) {
            final Boolean boxed = Boolean.valueOf(v);
            final MutableInt count = occurrences.get(boxed);
            if (count == null) {
                occurrences.put(boxed, new MutableInt(1));
            } else {
                count.increment();
            }
        }
        final BitSet toRemove = new BitSet();
        for (final Map.Entry<Boolean, MutableInt> e : occurrences.entrySet()) {
            final Boolean v = e.getKey();
View Full Code Here

        if (isEmpty(array) || isEmpty(values)) {
            return clone(array);
        }
        final HashMap<T, MutableInt> occurrences = new HashMap<T, MutableInt>(values.length);
        for (final T v : values) {
            final MutableInt count = occurrences.get(v);
            if (count == null) {
                occurrences.put(v, new MutableInt(1));
            } else {
                count.increment();
            }
        }
        final BitSet toRemove = new BitSet();
        for (final Map.Entry<T, MutableInt> e : occurrences.entrySet()) {
            final T v = e.getKey();
View Full Code Here

    public IteratorOfIterables(final Iterable<T>... iterables) {
        this(Arrays.asList(iterables));
    }

    public IteratorOfIterables(final List<Iterable<T>> iterables) {
        final MutableInt ind = new MutableInt(0);
        initialize(new Iterator<Iterable<T>>() {
            @Override
            public boolean hasNext() {
                return ind.intValue() < iterables.size();
            }

            @Override
            public Iterable<T> next() {
                Iterable<T> next = iterables.get(ind.intValue());
                ind.increment();
                return next;
            }

            @Override
            public void remove() {
View Full Code Here

    final ExCubeGameCloseUI cui = new ExCubeGameCloseUI();
    ExCubeGameExtendedChangePoints clientSetUp;

    for(Player tm : HardReferences.unwrap(bothTeams))
    {
      score.put(tm.getObjectId(), new MutableInt());

      tm.setCurrentCp(tm.getMaxCp());
      tm.setCurrentHp(tm.getMaxHp(), false);
      tm.setCurrentMp(tm.getMaxMp());
      clientSetUp = new ExCubeGameExtendedChangePoints(eventTime, team1Score, team2Score, isRedTeam(tm), tm, 0);
View Full Code Here

  /**
   * @param player Handles the increase of personal player points
   */
  private void addPlayerScore(Player player)
  {
    MutableInt points = score.get(player.getObjectId());
    points.increment();
  }
View Full Code Here

TOP

Related Classes of org.apache.commons.lang3.mutable.MutableInt

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.