本文整理汇总了Java中org.apache.commons.lang3.mutable.MutableBoolean.isFalse方法的典型用法代码示例。如果您正苦于以下问题:Java MutableBoolean.isFalse方法的具体用法?Java MutableBoolean.isFalse怎么用?Java MutableBoolean.isFalse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.lang3.mutable.MutableBoolean
的用法示例。
在下文中一共展示了MutableBoolean.isFalse方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toRangeClause
import org.apache.commons.lang3.mutable.MutableBoolean; //导入方法依赖的package包/类
private String toRangeClause(SqlgGraph sqlgGraph, MutableBoolean mutableOrderBy) {
if (this.sqlgRangeHolder != null && this.sqlgRangeHolder.isApplyOnDb()) {
if (this.sqlgRangeHolder.hasRange()) {
//This is MssqlServer, ugly but what to do???
String sql = "";
if (mutableOrderBy.isFalse() && sqlgGraph.getSqlDialect().isMssqlServer() && this.getDbComparators().isEmpty()) {
sql = "\n\tORDER BY 1\n\t";
}
return sql + "\n" + sqlgGraph.getSqlDialect().getRangeClause(this.sqlgRangeHolder.getRange());
} else {
Preconditions.checkState(this.sqlgRangeHolder.hasSkip(), "If not a range query then it must be a skip.");
return sqlgGraph.getSqlDialect().getSkipClause(this.sqlgRangeHolder.getSkip());
}
}
return "";
}
示例2: onPunish
import org.apache.commons.lang3.mutable.MutableBoolean; //导入方法依赖的package包/类
private static void onPunish(Session session, String ... args) {
if (args.length < 2) return;
if (PlayerInfo.isModerator(session.getPlayerId())) {
int targetId = CharacterUtils.getCharacterIdByName(args[1]);
MutableBoolean targetFound = new MutableBoolean(false);
ServerManager.getSession(targetId).ifPresent(target -> {
ChatUtils.sendServerMessage(target, "You have been punished by a moderator.");
target.close();
ChatUtils.sendServerMessage(session, "Player punished: " + args[1]);
targetFound.setTrue();
});
if (targetFound.isFalse()) {
ChatUtils.sendServerMessage(session, "Player not found.");
}
}
}
示例3: categoriseSequences
import org.apache.commons.lang3.mutable.MutableBoolean; //导入方法依赖的package包/类
private boolean categoriseSequences(BDD bdd, SortedSet<IOBehaviour> sequences, List<IOBehaviour> falling, List<IOBehaviour> rising, List<IOBehaviour> constant) {
for(IOBehaviour beh : sequences) {
BDD startBDD = bdd;
MutableBoolean resultStart = new MutableBoolean();
if(!evaluateBDD(resultStart, startBDD, beh.getStart())) {
logger.error("Something went wrong");
return false;
}
BDD endBDD = bdd;
MutableBoolean resultEnd = new MutableBoolean();
if(!evaluateBDD(resultEnd, endBDD, beh.getEnd())) {
logger.error("Something went wrong");
return false;
}
if(resultStart.isTrue() && resultEnd.isFalse()) {
falling.add(beh);
//System.out.println("uups? falling?");
} else if(resultStart.isFalse() && resultEnd.isTrue()) {
rising.add(beh);
} else if(resultStart.isFalse() && resultEnd.isFalse()) {
constant.add(beh);
} else {
logger.error("Const 1 should not happen");
return false;
}
//System.out.println(resultStart.booleanValue() + "=>" + resultEnd.booleanValue() + " : " + beh);
}
return true;
}
示例4: playerReady
import org.apache.commons.lang3.mutable.MutableBoolean; //导入方法依赖的package包/类
public static void playerReady(Session session, ClientMessage msg) {
int roomId = msg.readShort();
int playerId = session.getPlayerId();
if (session.getRoomId() == roomId) {
MutableBoolean roomLoading = new MutableBoolean(false);
RoomManager.getRoomById(roomId)
.filter(Room::isLoading)
.ifPresent(room -> {
if (!room.getConfirmedPlayers().contains(playerId)) {
room.getConfirmedPlayers().add(playerId);
// Instead of waiting 5 seconds (or not), we send an udp ping immediately to
// the client so we can update his udp port (if changed) before match starts
UdpPing.sendUdpPing(session);
}
if (room.getConfirmedPlayers().size() >= room.getCurrentSize()) {
room.setState(RoomState.PLAYING);
room.setTimeStart(DateUtils.currentTimeMillis());
room.broadcast(MessageBuilder.playerReady((short) 0));
if (room.getLoadingTimeoutFuture().isCancellable()) {
room.getLoadingTimeoutFuture().cancel(true);
}
}
roomLoading.setTrue();
});
if (roomLoading.isFalse()) {
session.send(MessageBuilder.playerReady((short) 0));
}
}
}
示例5: playerReady
import org.apache.commons.lang3.mutable.MutableBoolean; //导入方法依赖的package包/类
public static void playerReady(Session session, ClientMessage msg) {
int roomId = msg.readShort();
int playerId = session.getPlayerId();
MutableBoolean roomFound = new MutableBoolean(false);
getRoomById(roomId).filter(room -> room.isLoading() && room.isPlayerIn(playerId))
.ifPresent(room -> {
if (!room.getConfirmedPlayers().contains(playerId)) {
room.getConfirmedPlayers().add(playerId);
// Instead of waiting 5 seconds (or not), we send an udp ping immediately to
// the client so we can update his udp port (if changed) before match starts
UdpPing.sendUdpPing(session);
}
if (room.getConfirmedPlayers().size() >= room.getCurrentSize()) {
room.setState(RoomState.PLAYING);
room.setTimeStart(DateUtils.currentTimeMillis());
room.broadcast(MessageBuilder.playerReady((short) 0));
if (room.getLoadingTimeoutFuture().isCancellable()) {
room.getLoadingTimeoutFuture().cancel(true);
}
}
roomFound.setTrue();
});
if (roomFound.isFalse()) {
session.send(MessageBuilder.playerReady((short) 0));
}
}
示例6: removeInternal
import org.apache.commons.lang3.mutable.MutableBoolean; //导入方法依赖的package包/类
private boolean removeInternal(K key, Timestamp timestamp) {
if (timestamp == null) {
return false;
}
counter.incrementCount();
final MutableBoolean updated = new MutableBoolean(false);
items.compute(key, (k, existing) -> {
if (existing != null && existing.isNewerThan(timestamp)) {
updated.setFalse();
return existing;
} else {
updated.setTrue();
// remove from items map
return null;
}
});
if (updated.isFalse()) {
return false;
}
boolean updatedTombstone = false;
if (!tombstonesDisabled) {
Timestamp removedTimestamp = removedItems.get(key);
if (removedTimestamp == null) {
//Timestamp removed = removedItems.putIfAbsent(key, timestamp);
updatedTombstone = (removedItems.putIfAbsent(key, timestamp) == null);
} else if (timestamp.isNewerThan(removedTimestamp)) {
updatedTombstone = removedItems.replace(key, removedTimestamp, timestamp);
}
}
if (updated.booleanValue() && persistent) {
persistentStore.remove(key, timestamp);
}
return (!tombstonesDisabled && updatedTombstone) || updated.booleanValue();
}