当前位置: 首页>>代码示例>>Java>>正文


Java MutableBoolean.isFalse方法代码示例

本文整理汇总了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 "";
}
 
开发者ID:pietermartin,项目名称:sqlg,代码行数:17,代码来源:SchemaTableTree.java

示例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.");
        }
    }
}
 
开发者ID:neikeq,项目名称:KicksEmu,代码行数:23,代码来源:ChatCommands.java

示例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;
}
 
开发者ID:hpiasg,项目名称:asglogic,代码行数:31,代码来源:SequenceBasedAndGateDecomposer.java

示例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));
        }
    }
}
 
开发者ID:neikeq,项目名称:KicksEmu,代码行数:37,代码来源:RoomMessages.java

示例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));
    }
}
 
开发者ID:neikeq,项目名称:KicksEmu,代码行数:34,代码来源:ChallengeRoomMessages.java

示例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();
}
 
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:42,代码来源:EventuallyConsistentMapImpl.java


注:本文中的org.apache.commons.lang3.mutable.MutableBoolean.isFalse方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。