bettingpool.java
来自「这是远程web服务调用的一个包,可以将JSP直接作为服务」· Java 代码 · 共 53 行
JAVA
53 行
package tutorial.persistence;public class BettingPool { public static void reset() { for (int i = 0; i < _games.length; i++) _games[i] = new BettingPoolGame(); _tieBreakerIndex = 0; _state = INITIAL_STATE; } public static BettingPoolGame[] getGames() { return _games; } public static int getTieBreakerIndex() { return _tieBreakerIndex; } public static void setTieBreakerIndex( int tieBreakerIndex ) { if (!isEditable()) throw new IllegalStateException( "May only modify the pool in INITIAL state" ); _tieBreakerIndex = tieBreakerIndex; } public static boolean isEditable() { return _state == INITIAL_STATE; } public static void openPool() { if (!isEditable()) throw new IllegalStateException( "May only modify the pool in INITIAL state" ); _state = POOL_OPEN; } private final static int NUM_GAMES = 10; private final static int INITIAL_STATE = 0; private final static int POOL_OPEN = 1; private static int _state; private static int _tieBreakerIndex; private static BettingPoolGame[] _games = new BettingPoolGame[ NUM_GAMES ];}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?