org.apache.commons.lang.mutable.MutableInt#intValue ( )源码实例Demo

下面列出了org.apache.commons.lang.mutable.MutableInt#intValue ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: datawave   文件: FlagMaker.java
/**
 * Determine the number of unprocessed flag files in the flag directory
 * 
 * @param fc
 * @return the flag found for this ingest pool
 */
private int countFlagFileBacklog(final FlagDataTypeConfig fc) {
    final MutableInt fileCounter = new MutableInt(0);
    final FileFilter fileFilter = new WildcardFileFilter("*_" + fc.getIngestPool() + "_" + fc.getDataName() + "_*.flag");
    final FileVisitor<java.nio.file.Path> visitor = new SimpleFileVisitor<java.nio.file.Path>() {
        
        @Override
        public FileVisitResult visitFile(java.nio.file.Path path, BasicFileAttributes attrs) throws IOException {
            if (fileFilter.accept(path.toFile())) {
                fileCounter.increment();
            }
            return super.visitFile(path, attrs);
        }
    };
    try {
        Files.walkFileTree(Paths.get(fmc.getFlagFileDirectory()), visitor);
    } catch (IOException e) {
        // unable to get a flag count....
        log.error("Unable to get flag file count", e);
        return -1;
    }
    return fileCounter.intValue();
}
 
源代码2 项目: systemds   文件: ReaderTextLIBSVM.java
private static long readLIBSVMMatrixFromInputStream( InputStream is, String srcInfo, MatrixBlock dest, MutableInt rowPos, 
		long rlen, long clen, int blen )
	throws IOException
{
	SparseRowVector vect = new SparseRowVector(1024);
	String value = null;
	int row = rowPos.intValue();
	long lnnz = 0;
	
	// Read the data
	try( BufferedReader br = new BufferedReader(new InputStreamReader(is)) ) {
		while( (value=br.readLine())!=null ) { //for each line
			String rowStr = value.toString().trim();
			lnnz += ReaderTextLIBSVM.parseLibsvmRow(rowStr, vect, (int)clen);
			dest.appendRow(row, vect);
			row++;
		}
	}
	
	rowPos.setValue(row);
	return lnnz;
}
 
源代码3 项目: incubator-pinot   文件: RequestUtils.java
private static FilterQuery traverseFilterQueryAndPopulateMap(FilterQueryTree tree,
    Map<Integer, FilterQuery> filterQueryMap, MutableInt currentId) {
  int currentNodeId = currentId.intValue();
  currentId.increment();

  final List<Integer> f = new ArrayList<>();
  if (null != tree.getChildren()) {
    for (final FilterQueryTree c : tree.getChildren()) {
      final FilterQuery q = traverseFilterQueryAndPopulateMap(c, filterQueryMap, currentId);
      int childNodeId = q.getId();
      f.add(childNodeId);
      filterQueryMap.put(childNodeId, q);
    }
  }

  FilterQuery query = new FilterQuery();
  query.setColumn(tree.getColumn());
  query.setId(currentNodeId);
  query.setNestedFilterQueryIds(f);
  query.setOperator(tree.getOperator());
  query.setValue(tree.getValue());
  return query;
}
 
源代码4 项目: ScoreboardStats   文件: RefreshTask.java
@Override
public void run() {
    //let the players update smoother
    int remainingUpdates = getNextUpdates();
    for (Map.Entry<Player, MutableInt> entry : queue.entrySet()) {
        Player player = entry.getKey();
        MutableInt remainingTicks = entry.getValue();
        if (remainingTicks.intValue() == 0) {
            if (remainingUpdates != 0) {
                //Smoother refreshing; limit the updates
                plugin.getScoreboardManager().onUpdate(player);
                remainingTicks.setValue(20 * Settings.getInterval());
                remainingUpdates--;
            }
        } else {
            remainingTicks.decrement();
        }
    }

    nextGlobalUpdate--;
    if (nextGlobalUpdate == 0) {
        nextGlobalUpdate = 20 * Settings.getInterval();
        //update globals
        plugin.getReplaceManager().updateGlobals();
    }
}
 
源代码5 项目: aion-germany   文件: NeviwindCanyonReward.java
public void addPointsByRace(Race race, int points) {
    MutableInt pointsByRace = getPointsByRace(race);
    pointsByRace.add(points);
    if (pointsByRace.intValue() < 0) {
        pointsByRace.setValue(0);
    }
}
 
源代码6 项目: aion-germany   文件: JormungandReward.java
public void addPvpKillsByRace(Race race, int points) {
	MutableInt racePoints = getPvpKillsByRace(race);
	racePoints.add(points);
	if (racePoints.intValue() < 0) {
		racePoints.setValue(0);
	}
}
 
源代码7 项目: aion-germany   文件: JormungandReward.java
public void addPointsByRace(Race race, int points) {
	MutableInt racePoints = getPointsByRace(race);
	racePoints.add(points);
	if (racePoints.intValue() < 0) {
		racePoints.setValue(0);
	}
}
 
源代码8 项目: aion-germany   文件: DredgionReward.java
public void addPointsByRace(Race race, int points) {
	MutableInt racePoints = getPointsByRace(race);
	racePoints.add(points);
	if (racePoints.intValue() < 0) {
		racePoints.setValue(0);
	}
}
 
源代码9 项目: aion-germany   文件: KamarBattlefieldReward.java
public void addPointsByRace(Race race, int points) {
	MutableInt racePoints = getPointsByRace(race);
	racePoints.add(points);
	if (racePoints.intValue() < 0) {
		racePoints.setValue(0);
	}
}
 
源代码10 项目: aion-germany   文件: KamarBattlefieldReward.java
public void addPvpKillsByRace(Race race, int points) {
	MutableInt racePoints = getPvpKillsByRace(race);
	racePoints.add(points);
	if (racePoints.intValue() < 0) {
		racePoints.setValue(0);
	}
}
 
源代码11 项目: attic-apex-malhar   文件: ArrayListTestSink.java
public int getCount(T key)
{
  int ret = -1;
  MutableInt val = map.get(key);
  if (val != null) {
    ret = val.intValue();
  }
  return ret;
}
 
源代码12 项目: tez   文件: DagAwareYarnTaskScheduler.java
private void decrVertexTaskCount(Priority priority, RequestPriorityStats stats, int vertexIndex) {
  Integer vertexIndexInt = vertexIndex;
  MutableInt taskCount = stats.vertexTaskCount.get(vertexIndexInt);
  taskCount.decrement();
  if (taskCount.intValue() <= 0) {
    removeVertexFromRequestStats(priority, stats, vertexIndexInt);
  }
}
 
public void addPvpKillsByRace(Race race, int points) {
	MutableInt racePoints = getPvpKillsByRace(race);
	racePoints.add(points);
	if (racePoints.intValue() < 0) {
		racePoints.setValue(0);
	}
}
 
源代码14 项目: aion-germany   文件: RunatoriumRuinsReward.java
public void addPointsByRace(Race race, int points) {
	MutableInt racePoints = getPointsByRace(race);
	racePoints.add(points);
	if (racePoints.intValue() < 0) {
		racePoints.setValue(0);
	}
}
 
源代码15 项目: aion-germany   文件: RunatoriumRuinsReward.java
public void addPvpKillsByRace(Race race, int points) {
	MutableInt racePoints = getPvpKillsByRace(race);
	racePoints.add(points);
	if (racePoints.intValue() < 0) {
		racePoints.setValue(0);
	}
}
 
源代码16 项目: aion-germany   文件: RunatoriumReward.java
public void addPointsByRace(Race race, int points) {
	MutableInt racePoints = getPointsByRace(race);
	racePoints.add(points);
	if (racePoints.intValue() < 0) {
		racePoints.setValue(0);
	}
}
 
源代码17 项目: aion-germany   文件: RunatoriumReward.java
public void addPvpKillsByRace(Race race, int points) {
	MutableInt racePoints = getPvpKillsByRace(race);
	racePoints.add(points);
	if (racePoints.intValue() < 0) {
		racePoints.setValue(0);
	}
}
 
源代码18 项目: zeno   文件: TypeDiffOperation.java
private boolean decrement(Map<Object, MutableInt> map, Object obj) {
    MutableInt i = map.get(obj);
    if(i == null) {
        return false;
    }

    i.decrement();

    if(i.intValue() == 0) {
        map.remove(obj);
    }

    return true;
}
 
源代码19 项目: lams   文件: TransactionRetryInterceptor.java
private void processException(Exception e, MethodInvocation invocation, MutableInt attempt) {

	StringBuilder message = new StringBuilder("When invoking method ")
		.append(invocation.getMethod().getDeclaringClass().getName()).append("#")
		.append(invocation.getMethod().getName()).append(" caught \"").append(e.getMessage())
		.append("\". Attempt #").append(attempt);

	attempt.increment();
	if (attempt.intValue() <= TransactionRetryInterceptor.MAX_ATTEMPTS) {
	    message.append(". Retrying.");
	} else {
	    message.append(". Giving up.");
	}
	TransactionRetryInterceptor.log.warn(message);
    }
 
源代码20 项目: attic-apex-malhar   文件: HashTestSink.java
public int getCount(T key)
{
  int ret = -1;
  MutableInt val = map.get(key);
  if (val != null) {
    ret = val.intValue();
  }
  return ret;
}