From 92cd27724a2162d460076013b0b6077eebd49626 Mon Sep 17 00:00:00 2001 From: Peter Osterlund Date: Mon, 13 Feb 2017 08:54:02 +0100 Subject: [PATCH] Removed redundant public access modifier for interface methods. --- CuckooChessEngine/src/chess/Player.java | 10 ++--- CuckooChessEngine/src/chess/Search.java | 8 ++-- .../src/guibase/GUIInterface.java | 22 +++++----- .../org/petero/droidfish/ActionFactory.java | 2 +- .../org/petero/droidfish/GUIInterface.java | 40 +++++++++---------- .../src/org/petero/droidfish/UIAction.java | 8 ++-- .../petero/droidfish/engine/UCIEngine.java | 32 +++++++-------- .../petero/droidfish/gamelogic/PgnToken.java | 8 ++-- .../droidfish/gamelogic/SearchListener.java | 18 ++++----- 9 files changed, 74 insertions(+), 74 deletions(-) diff --git a/CuckooChessEngine/src/chess/Player.java b/CuckooChessEngine/src/chess/Player.java index d0208f0..8272cf7 100644 --- a/CuckooChessEngine/src/chess/Player.java +++ b/CuckooChessEngine/src/chess/Player.java @@ -31,26 +31,26 @@ public interface Player { * This makes it possible for the player to correctly handle * the draw by repetition rule. */ - public String getCommand(Position pos, boolean drawOffer, List history); + String getCommand(Position pos, boolean drawOffer, List history); /** Return true if this player is a human player. */ - public boolean isHumanPlayer(); + boolean isHumanPlayer(); /** * Inform player whether or not to use an opening book. * Of course, a human player is likely to ignore this. */ - public void useBook(boolean bookOn); + void useBook(boolean bookOn); /** * Inform player about min recommended/max allowed thinking time per move. * Of course, a human player is likely to ignore this. */ - public void timeLimit(int minTimeLimit, int maxTimeLimit, boolean randomMode); + void timeLimit(int minTimeLimit, int maxTimeLimit, boolean randomMode); /** * Inform player that the transposition table should be cleared. * Of course, a human player has a hard time implementing this. */ - public void clearTT(); + void clearTT(); } diff --git a/CuckooChessEngine/src/chess/Search.java b/CuckooChessEngine/src/chess/Search.java index a89a356..64898ca 100644 --- a/CuckooChessEngine/src/chess/Search.java +++ b/CuckooChessEngine/src/chess/Search.java @@ -119,11 +119,11 @@ public class Search { * Used to get various search information during search */ public interface Listener { - public void notifyDepth(int depth); - public void notifyCurrMove(Move m, int moveNr); - public void notifyPV(int depth, int score, int time, long nodes, int nps, + void notifyDepth(int depth); + void notifyCurrMove(Move m, int moveNr); + void notifyPV(int depth, int score, int time, long nodes, int nps, boolean isMate, boolean upperBound, boolean lowerBound, ArrayList pv); - public void notifyStats(long nodes, int nps, int time); + void notifyStats(long nodes, int nps, int time); } Listener listener; diff --git a/CuckooChessEngine/src/guibase/GUIInterface.java b/CuckooChessEngine/src/guibase/GUIInterface.java index 54062bf..ab48503 100644 --- a/CuckooChessEngine/src/guibase/GUIInterface.java +++ b/CuckooChessEngine/src/guibase/GUIInterface.java @@ -24,35 +24,35 @@ import chess.Position; public interface GUIInterface { /** Update the displayed board position. */ - public void setPosition(Position pos); + void setPosition(Position pos); /** Mark square i as selected. Set to -1 to clear selection. */ - public void setSelection(int sq); + void setSelection(int sq); /** Set the status text. */ - public void setStatusString(String str); + void setStatusString(String str); /** Update the list of moves. */ - public void setMoveListString(String str); + void setMoveListString(String str); /** Update the computer thinking information. */ - public void setThinkingString(String str); + void setThinkingString(String str); /** Get the current time limit. */ - public int timeLimit(); + int timeLimit(); /** Get "random move" setting. */ - public boolean randomMode(); + boolean randomMode(); /** Return true if "show thinking" is enabled. */ - public boolean showThinking(); + boolean showThinking(); /** Ask what to promote a pawn to. Should call reportPromotePiece() when done. */ - public void requestPromotePiece(); + void requestPromotePiece(); /** Run code on the GUI thread. */ - public void runOnUIThread(Runnable runnable); + void runOnUIThread(Runnable runnable); /** Report that user attempted to make an invalid move. */ - public void reportInvalidMove(Move m); + void reportInvalidMove(Move m); } diff --git a/DroidFish/src/org/petero/droidfish/ActionFactory.java b/DroidFish/src/org/petero/droidfish/ActionFactory.java index 54cdebe..cc65e12 100644 --- a/DroidFish/src/org/petero/droidfish/ActionFactory.java +++ b/DroidFish/src/org/petero/droidfish/ActionFactory.java @@ -21,5 +21,5 @@ package org.petero.droidfish; public interface ActionFactory { /** Create action given an action ID. */ - public UIAction getAction(String actionId); + UIAction getAction(String actionId); } diff --git a/DroidFish/src/org/petero/droidfish/GUIInterface.java b/DroidFish/src/org/petero/droidfish/GUIInterface.java index eb3e3af..0c43ead 100644 --- a/DroidFish/src/org/petero/droidfish/GUIInterface.java +++ b/DroidFish/src/org/petero/droidfish/GUIInterface.java @@ -28,10 +28,10 @@ import org.petero.droidfish.gamelogic.Position; public interface GUIInterface { /** Update the displayed board position. */ - public void setPosition(Position pos, String variantInfo, ArrayList variantMoves); + void setPosition(Position pos, String variantInfo, ArrayList variantMoves); /** Mark square sq as selected. Set to -1 to clear selection. */ - public void setSelection(int sq); + void setSelection(int sq); final static class GameStatus { public Game.GameState state = Game.GameState.ALIVE; @@ -45,10 +45,10 @@ public interface GUIInterface { } /** Set the status text. */ - public void setStatus(GameStatus status); + void setStatus(GameStatus status); /** Update the list of moves. */ - public void moveListUpdated(); + void moveListUpdated(); final public static class ThinkingInfo { public int id; @@ -62,50 +62,50 @@ public interface GUIInterface { } /** Update the computer thinking information. */ - public void setThinkingInfo(ThinkingInfo ti); + void setThinkingInfo(ThinkingInfo ti); /** Ask what to promote a pawn to. Should call reportPromotePiece() when done. */ - public void requestPromotePiece(); + void requestPromotePiece(); /** Run code on the GUI thread. */ - public void runOnUIThread(Runnable runnable); + void runOnUIThread(Runnable runnable); /** Report that user attempted to make an invalid move. */ - public void reportInvalidMove(Move m); + void reportInvalidMove(Move m); /** Report UCI engine name. */ - public void reportEngineName(String engine); + void reportEngineName(String engine); /** Report UCI engine error message. */ - public void reportEngineError(String errMsg); + void reportEngineError(String errMsg); /** Called when a move is played. GUI can notify user, for example by playing a sound. */ - public void movePlayed(Position pos, Move move, boolean computerMove); + void movePlayed(Position pos, Move move, boolean computerMove); /** Report remaining thinking time to GUI. */ - public void setRemainingTime(int wTime, int bTime, int nextUpdate); + void setRemainingTime(int wTime, int bTime, int nextUpdate); /** Update engine title text. */ - public void updateEngineTitle(); + void updateEngineTitle(); /** Update title with the material difference. */ - public void updateMaterialDifferenceTitle(Util.MaterialDiff diff); + void updateMaterialDifferenceTitle(Util.MaterialDiff diff); /** Update title with time control information. */ - public void updateTimeControlTitle(); + void updateTimeControlTitle(); /** Report a move made that is a candidate for GUI animation. */ - public void setAnimMove(Position sourcePos, Move move, boolean forward); + void setAnimMove(Position sourcePos, Move move, boolean forward); /** Return true if positive analysis scores means good for white. */ - public boolean whiteBasedScores(); + boolean whiteBasedScores(); /** Return true if pondering (permanent brain) is enabled. */ - public boolean ponderMode(); + boolean ponderMode(); /** Get the default player name. */ - public String playerName(); + String playerName(); /** Return true if only main-line moves are to be kept. */ - public boolean discardVariations(); + boolean discardVariations(); } diff --git a/DroidFish/src/org/petero/droidfish/UIAction.java b/DroidFish/src/org/petero/droidfish/UIAction.java index 43515a1..6b77f48 100644 --- a/DroidFish/src/org/petero/droidfish/UIAction.java +++ b/DroidFish/src/org/petero/droidfish/UIAction.java @@ -21,14 +21,14 @@ package org.petero.droidfish; /** Interface for user interface actions. */ public interface UIAction extends Runnable { /** Get a unique identifier for this action. */ - public String getId(); + String getId(); /** Get name resource for the action. */ - public int getName(); + int getName(); /** Get icon SVG resource or -1 for no icon. */ - public int getIcon(); + int getIcon(); /** Return true if the action is currently enabled. */ - public boolean enabled(); + boolean enabled(); } diff --git a/DroidFish/src/org/petero/droidfish/engine/UCIEngine.java b/DroidFish/src/org/petero/droidfish/engine/UCIEngine.java index 82b9dc0..e24c2fc 100644 --- a/DroidFish/src/org/petero/droidfish/engine/UCIEngine.java +++ b/DroidFish/src/org/petero/droidfish/engine/UCIEngine.java @@ -31,29 +31,29 @@ public interface UCIEngine { } /** Start engine. */ - public void initialize(); + void initialize(); /** Initialize default options. */ - public void initOptions(EngineOptions engineOptions); + void initOptions(EngineOptions engineOptions); /** Read UCI options from .ini file and send them to the engine. */ - public void applyIniFile(); + void applyIniFile(); /** Set engine UCI options. */ - public boolean setUCIOptions(Map uciOptions); + boolean setUCIOptions(Map uciOptions); /** Save non-default UCI option values to file. */ - public void saveIniFile(UCIOptions options); + void saveIniFile(UCIOptions options); /** Get engine UCI options. */ - public UCIOptions getUCIOptions(); + UCIOptions getUCIOptions(); /** Return true if engine options have correct values. * If false is returned, engine will be restarted. */ - public boolean optionsOk(EngineOptions engineOptions); + boolean optionsOk(EngineOptions engineOptions); /** Shut down engine. */ - public void shutDown(); + void shutDown(); /** * Read a line from the engine. @@ -62,30 +62,30 @@ public interface UCIEngine { * or empty string if no data available, * or null if I/O error. */ - public String readLineFromEngine(int timeoutMillis); + String readLineFromEngine(int timeoutMillis); // FIXME!! Writes should be handled by separate thread. /** Write a line to the engine. \n will be added automatically. */ - public void writeLineToEngine(String data); + void writeLineToEngine(String data); /** Set the engine strength, allowed values 0 - 1000. */ - public void setStrength(int strength); + void setStrength(int strength); /** Set an engine integer option. */ - public void setOption(String name, int value); + void setOption(String name, int value); /** Set an engine boolean option. */ - public void setOption(String name, boolean value); + void setOption(String name, boolean value); /** Set an engine option. If the option is not a string option, * value is converted to the correct type. * @return True if the option was changed. */ - public boolean setOption(String name, String value); + boolean setOption(String name, String value); /** Clear list of supported options. */ - public void clearOptions(); + void clearOptions(); /** Register an option as supported by the engine. * @param tokens The UCI option line sent by the engine, split in words. */ - public UCIOptions.OptionBase registerOption(String[] tokens); + UCIOptions.OptionBase registerOption(String[] tokens); } diff --git a/DroidFish/src/org/petero/droidfish/gamelogic/PgnToken.java b/DroidFish/src/org/petero/droidfish/gamelogic/PgnToken.java index 52c79d3..a34333a 100644 --- a/DroidFish/src/org/petero/droidfish/gamelogic/PgnToken.java +++ b/DroidFish/src/org/petero/droidfish/gamelogic/PgnToken.java @@ -49,15 +49,15 @@ public class PgnToken { /** PGN parser visitor interface. */ public interface PgnTokenReceiver { /** If this method returns false, the object needs a full re-initialization, using clear() and processToken(). */ - public boolean isUpToDate(); + boolean isUpToDate(); /** Clear object state. */ - public void clear(); + void clear(); /** Update object state with one token from a PGN game. */ - public void processToken(GameTree.Node node, int type, String token); + void processToken(GameTree.Node node, int type, String token); /** Change current move number. */ - public void setCurrent(GameTree.Node node); + void setCurrent(GameTree.Node node); } } diff --git a/DroidFish/src/org/petero/droidfish/gamelogic/SearchListener.java b/DroidFish/src/org/petero/droidfish/gamelogic/SearchListener.java index 1f50390..804b0b0 100644 --- a/DroidFish/src/org/petero/droidfish/gamelogic/SearchListener.java +++ b/DroidFish/src/org/petero/droidfish/gamelogic/SearchListener.java @@ -56,30 +56,30 @@ public interface SearchListener { } /** Report current engine search depth. */ - public void notifyDepth(int id, int depth); + void notifyDepth(int id, int depth); /** Report the move, valid in position pos, that the engine is currently searching. */ - public void notifyCurrMove(int id, Position pos, Move m, int moveNr); + void notifyCurrMove(int id, Position pos, Move m, int moveNr); /** * Report PV information. If ponderMove is non-null, ponderMove is the first move * to play from position pos. */ - public void notifyPV(int id, Position pos, ArrayList pvInfo, Move ponderMove); + void notifyPV(int id, Position pos, ArrayList pvInfo, Move ponderMove); /** Report search statistics. */ - public void notifyStats(int id, long nodes, int nps, long tbHits, int hash, int time); + void notifyStats(int id, long nodes, int nps, long tbHits, int hash, int time); /** Report opening book information. */ - public void notifyBookInfo(int id, String bookInfo, ArrayList moveList, - String eco, int distToEcoTree); + void notifyBookInfo(int id, String bookInfo, ArrayList moveList, + String eco, int distToEcoTree); /** Report move (or command, such as "resign") played by the engine. */ - public void notifySearchResult(int id, String cmd, Move ponder); + void notifySearchResult(int id, String cmd, Move ponder); /** Report engine name. */ - public void notifyEngineName(String engineName); + void notifyEngineName(String engineName); /** Report engine error. */ - public void reportEngineError(String errMsg); + void reportEngineError(String errMsg); }