Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make comments more compact

  • Loading branch information...
commit 8a713fe949bf62b051376595d3566c548b9274b2 1 parent 01e2467
Markus Enzenberger authored
Showing with 634 additions and 1,250 deletions.
  1. +1 −2  mac/src/net/sf/gogui/specialmac/RegisterSpecialMacHandler.java
  2. +2 −4 src/net/sf/gogui/boardpainter/BoardPainter.java
  3. +2 −4 src/net/sf/gogui/boardpainter/BoardPainterUtil.java
  4. +1 −2  src/net/sf/gogui/boardpainter/ConstField.java
  5. +1 −2  src/net/sf/gogui/boardpainter/Field.java
  6. +1 −2  src/net/sf/gogui/boardpainter/RadialGradientContext.java
  7. +1 −2  src/net/sf/gogui/boardpainter/RadialGradientPaint.java
  8. +1 −2  src/net/sf/gogui/game/BoardUpdater.java
  9. +12 −24 src/net/sf/gogui/game/Clock.java
  10. +1 −2  src/net/sf/gogui/game/ConstClock.java
  11. +1 −2  src/net/sf/gogui/game/ConstGame.java
  12. +1 −2  src/net/sf/gogui/game/ConstGameInfo.java
  13. +1 −2  src/net/sf/gogui/game/ConstGameTree.java
  14. +1 −2  src/net/sf/gogui/game/ConstNode.java
  15. +1 −2  src/net/sf/gogui/game/ConstSgfProperties.java
  16. +8 −16 src/net/sf/gogui/game/Game.java
  17. +5 −10 src/net/sf/gogui/game/GameInfo.java
  18. +4 −8 src/net/sf/gogui/game/GameTree.java
  19. +1 −2  src/net/sf/gogui/game/MarkType.java
  20. +52 −104 src/net/sf/gogui/game/Node.java
  21. +29 −54 src/net/sf/gogui/game/NodeUtil.java
  22. +2 −4 src/net/sf/gogui/game/SgfProperties.java
  23. +9 −18 src/net/sf/gogui/game/TimeSettings.java
  24. +1 −2  src/net/sf/gogui/gamefile/GameFileFilter.java
  25. +1 −2  src/net/sf/gogui/gamefile/GameFileUtil.java
  26. +1 −2  src/net/sf/gogui/gamefile/GameReader.java
  27. +1 −2  src/net/sf/gogui/go/BlackWhiteEmptySet.java
  28. +31 −60 src/net/sf/gogui/go/Board.java
  29. +6 −12 src/net/sf/gogui/go/BoardConstants.java
  30. +5 −10 src/net/sf/gogui/go/BoardUtil.java
  31. +1 −2  src/net/sf/gogui/go/ConstBoard.java
  32. +1 −2  src/net/sf/gogui/go/ConstPointList.java
  33. +7 −14 src/net/sf/gogui/go/CountScore.java
  34. +4 −8 src/net/sf/gogui/go/GoColor.java
  35. +15 −30 src/net/sf/gogui/go/GoPoint.java
  36. +1 −2  src/net/sf/gogui/go/InvalidPointException.java
  37. +3 −6 src/net/sf/gogui/go/Komi.java
  38. +8 −16 src/net/sf/gogui/go/Marker.java
  39. +7 −14 src/net/sf/gogui/go/Move.java
  40. +1 −2  src/net/sf/gogui/go/MoveUtil.java
  41. +7 −14 src/net/sf/gogui/go/PointList.java
  42. +1 −2  src/net/sf/gogui/go/Score.java
  43. +16 −30 src/net/sf/gogui/gogui/GoGui.java
  44. +2 −4 src/net/sf/gogui/gogui/GoGuiActions.java
  45. +2 −4 src/net/sf/gogui/gogui/GoGuiSettings.java
  46. +1 −2  src/net/sf/gogui/gogui/Interrupt.java
  47. +1 −2  src/net/sf/gogui/gogui/Main.java
  48. +1 −2  src/net/sf/gogui/gogui/MainWrapper.java
  49. +1 −2  src/net/sf/gogui/gogui/ShowAnalyzeText.java
  50. +1 −2  src/net/sf/gogui/gtp/AnalyzeCommand.java
  51. +2 −4 src/net/sf/gogui/gtp/AnalyzeDefinition.java
  52. +1 −2  src/net/sf/gogui/gtp/AnalyzeType.java
  53. +2 −4 src/net/sf/gogui/gtp/AnalyzeUtil.java
  54. +1 −2  src/net/sf/gogui/gtp/GtpCallback.java
  55. +14 −28 src/net/sf/gogui/gtp/GtpClient.java
  56. +30 −58 src/net/sf/gogui/gtp/GtpClientBase.java
  57. +3 −6 src/net/sf/gogui/gtp/GtpClientUtil.java
  58. +25 −50 src/net/sf/gogui/gtp/GtpCommand.java
  59. +10 −18 src/net/sf/gogui/gtp/GtpEngine.java
  60. +1 −2  src/net/sf/gogui/gtp/GtpError.java
  61. +1 −2  src/net/sf/gogui/gtp/GtpResponseFormatError.java
  62. +6 −12 src/net/sf/gogui/gtp/GtpSynchronizer.java
  63. +4 −8 src/net/sf/gogui/gtp/GtpUtil.java
  64. +1 −2  src/net/sf/gogui/gtp/ParameterType.java
  65. +2 −4 src/net/sf/gogui/gui/AnalyzeDialog.java
  66. +3 −6 src/net/sf/gogui/gui/AnalyzeShow.java
  67. +1 −2  src/net/sf/gogui/gui/ConstGuiBoard.java
  68. +3 −6 src/net/sf/gogui/gui/FileDialogs.java
  69. +1 −2  src/net/sf/gogui/gui/GameTreePanel.java
  70. +1 −2  src/net/sf/gogui/gui/GtpShellText.java
  71. +31 −62 src/net/sf/gogui/gui/GuiBoard.java
  72. +2 −4 src/net/sf/gogui/gui/GuiBoardUtil.java
  73. +4 −8 src/net/sf/gogui/gui/GuiGtpClient.java
  74. +16 −32 src/net/sf/gogui/gui/GuiUtil.java
  75. +2 −4 src/net/sf/gogui/gui/Help.java
  76. +2 −4 src/net/sf/gogui/gui/LiveGfx.java
  77. +4 −6 src/net/sf/gogui/gui/MessageDialogs.java
  78. +1 −2  src/net/sf/gogui/gui/ParameterDialog.java
  79. +2 −4 src/net/sf/gogui/gui/Program.java
  80. +1 −2  src/net/sf/gogui/gui/ProgramEditor.java
  81. +1 −2  src/net/sf/gogui/gui/RecentFileMenu.java
  82. +1 −2  src/net/sf/gogui/gui/RecentMenu.java
  83. +6 −12 src/net/sf/gogui/gui/SquareLayout.java
  84. +3 −6 src/net/sf/gogui/gui/StatusBar.java
  85. +1 −2  src/net/sf/gogui/gui/SwitchLanguageDialog.java
  86. +1 −2  src/net/sf/gogui/sgf/SgfError.java
  87. +7 −14 src/net/sf/gogui/sgf/SgfReader.java
  88. +2 −4 src/net/sf/gogui/sgf/SgfUtil.java
  89. +2 −4 src/net/sf/gogui/sgf/SgfWriter.java
  90. +4 −8 src/net/sf/gogui/text/TextParser.java
  91. +4 −8 src/net/sf/gogui/thumbnail/ThumbnailCreator.java
  92. +1 −2  src/net/sf/gogui/thumbnail/ThumbnailReader.java
  93. +4 −8 src/net/sf/gogui/thumbnail/ThumbnailUtil.java
  94. +3 −6 src/net/sf/gogui/tools/adapter/Adapter.java
  95. +1 −2  src/net/sf/gogui/tools/display/Display.java
  96. +1 −2  src/net/sf/gogui/tools/dummy/Dummy.java
  97. +6 −12 src/net/sf/gogui/tools/regress/Regress.java
  98. +2 −4 src/net/sf/gogui/tools/regress/RegressUtil.java
  99. +1 −2  src/net/sf/gogui/tools/server/Server.java
  100. +13 −26 src/net/sf/gogui/tools/statistics/Plot.java
  101. +5 −10 src/net/sf/gogui/tools/statistics/Statistics.java
  102. +1 −2  src/net/sf/gogui/tools/terminal/Terminal.java
  103. +1 −2  src/net/sf/gogui/tools/thumbnailer/Main.java
  104. +2 −4 src/net/sf/gogui/tools/twogtp/Compare.java
  105. +3 −6 src/net/sf/gogui/tools/twogtp/Program.java
  106. +4 −6 src/net/sf/gogui/tools/twogtp/TwoGtp.java
  107. +2 −4 src/net/sf/gogui/util/ErrorMessage.java
  108. +6 −12 src/net/sf/gogui/util/FileUtil.java
  109. +1 −2  src/net/sf/gogui/util/HtmlUtil.java
  110. +17 −32 src/net/sf/gogui/util/Options.java
  111. +7 −14 src/net/sf/gogui/util/Platform.java
  112. +4 −8 src/net/sf/gogui/util/PrefUtil.java
  113. +2 −4 src/net/sf/gogui/util/ProcessUtil.java
  114. +4 −8 src/net/sf/gogui/util/RecentFileStorage.java
  115. +10 −20 src/net/sf/gogui/util/Statistics.java
  116. +2 −4 src/net/sf/gogui/util/StreamCopy.java
  117. +1 −2  src/net/sf/gogui/util/StreamDiscard.java
  118. +6 −12 src/net/sf/gogui/util/StringUtil.java
  119. +4 −8 src/net/sf/gogui/util/Table.java
  120. +3 −6 src/net/sf/gogui/util/TableUtil.java
  121. +2 −4 src/net/sf/gogui/util/XmlUtil.java
  122. +8 −16 src/net/sf/gogui/xml/XmlReader.java
  123. +2 −4 src/net/sf/gogui/xml/XmlWriter.java
  124. +1 −2  test/junit/src/net/sf/gogui/game/BoardUpdaterTest.java
  125. +1 −2  test/junit/src/net/sf/gogui/game/ClockTest.java
  126. +1 −2  test/junit/src/net/sf/gogui/game/GameTest.java
  127. +1 −2  test/junit/src/net/sf/gogui/game/NodeUtilTest.java
  128. +1 −2  test/junit/src/net/sf/gogui/go/BoardConstantsTest.java
  129. +1 −2  test/junit/src/net/sf/gogui/go/BoardTest.java
  130. +1 −2  test/junit/src/net/sf/gogui/gtp/AnalyzeCommandTest.java
  131. +1 −2  test/junit/src/net/sf/gogui/gtp/GtpEngineClient.java
  132. +1 −2  test/junit/src/net/sf/gogui/gtp/GtpEngineConnection.java
  133. +1 −2  test/junit/src/net/sf/gogui/gtp/GtpExpectEngine.java
  134. +3 −6 test/junit/src/net/sf/gogui/gtp/GtpSynchronizerTest.java
  135. +2 −4 test/junit/src/net/sf/gogui/sgf/SgfReaderTest.java
  136. +1 −2  test/junit/src/net/sf/gogui/sgf/SgfWriterTest.java
  137. +1 −2  test/junit/src/net/sf/gogui/tex/TexWriterTest.java
  138. +1 −2  test/junit/src/net/sf/gogui/text/TextParserTest.java
  139. +2 −4 test/junit/src/net/sf/gogui/thumbnail/ThumbnailUtilTest.java
  140. +3 −6 test/junit/src/net/sf/gogui/tools/adapter/AdapterTest.java
  141. +2 −4 test/junit/src/net/sf/gogui/xml/XmlReaderTest.java
  142. +6 −12 test/junit/src/net/sf/gogui/xml/XmlWriterTest.java
View
3  mac/src/net/sf/gogui/specialmac/RegisterSpecialMacHandler.java
@@ -35,8 +35,7 @@ public void handleQuit(ApplicationEvent event)
/** Registration of handler for events from Mac Application menu.
This class depends on com.apple and should therefore only
- loaded if the platform is Mac using reflection.
- */
+ loaded if the platform is Mac using reflection. */
public class RegisterSpecialMacHandler
{
public RegisterSpecialMacHandler(Platform.SpecialMacHandler handler)
View
6 src/net/sf/gogui/boardpainter/BoardPainter.java
@@ -37,8 +37,7 @@ public BoardPainter()
@param graphics The graphics object.
@param field The fields.
@param width The width/height of the image.
- @param showGrid Show grid coordinates.
- */
+ @param showGrid Show grid coordinates. */
public void draw(Graphics graphics, ConstField[][] field, int width,
boolean showGrid)
{
@@ -108,8 +107,7 @@ to ensure that all fields have exactly the same size (in pixels).
If a preferred field size is known (e.g. from a different board size,
or from the last settings), then using the board size returned by this
function will draw the board such that the field size is exactly the
- preferred one.
- */
+ preferred one. */
public static Dimension getPreferredSize(int preferredFieldSize,
int boardSize, boolean showGrid)
{
View
6 src/net/sf/gogui/boardpainter/BoardPainterUtil.java
@@ -27,8 +27,7 @@ public static BufferedImage createImage(int width, int height)
}
/** Use a painter to paint the board in a buffered image.
- The image can be written to a file with writeImage().
- */
+ The image can be written to a file with writeImage(). */
public static BufferedImage getImage(BoardPainter painter,
ConstField[][] field, int width,
int height)
@@ -41,8 +40,7 @@ public static BufferedImage getImage(BoardPainter painter,
}
/** Write an image in PNG format to a file.
- @param metaData Optional PNG meta data (or null)
- */
+ @param metaData Optional PNG meta data (or null) */
public static void writeImage(BufferedImage image, File file,
Map<String,String> metaData)
throws IOException
View
3  src/net/sf/gogui/boardpainter/ConstField.java
@@ -8,8 +8,7 @@
import net.sf.gogui.go.GoColor;
/** Const functions of Field.
- @see Field
-*/
+ @see Field */
public interface ConstField
{
void draw(Graphics graphics, int size, int x, int y, Image boardImage,
View
3  src/net/sf/gogui/boardpainter/Field.java
@@ -206,8 +206,7 @@ public void setSelect(boolean select)
It can be used to display stones which are not part of the current
board position (e.g. search variations)
@param color The color of the shadow stone or null to remove a
- shadow stone.
- */
+ shadow stone. */
public void setGhostStone(GoColor color)
{
m_ghostStone = color;
View
3  src/net/sf/gogui/boardpainter/RadialGradientContext.java
@@ -20,8 +20,7 @@
@param focus Focus shift away from the center along second radius
normalized to interval between zero and one.
@param color1 First color.
- @param color2 Second color.
- */
+ @param color2 Second color. */
public RadialGradientContext(Point2D center, Point2D radius1,
Point2D radius2, double focus, Color color1,
Color color2)
View
3  src/net/sf/gogui/boardpainter/RadialGradientPaint.java
@@ -23,8 +23,7 @@
@param focus Focus shift away from the center along second radius
normalized to interval between zero and one.
@param color1 First color.
- @param color2 Second color.
- */
+ @param color2 Second color. */
public RadialGradientPaint(Point2D center, Point2D radius1,
Point2D radius2, double focus, Color color1,
Color color2)
View
3  src/net/sf/gogui/game/BoardUpdater.java
@@ -85,7 +85,6 @@ else if (player != null)
}
/** Local variable used in update.
- Member variable for avoiding frequent new memory allocations.
- */
+ Member variable for avoiding frequent new memory allocations. */
private final ArrayList<ConstNode> m_nodes;
}
View
36 src/net/sf/gogui/game/Clock.java
@@ -13,8 +13,7 @@
/** Time control for a Go game.
If the clock is not initialized with Clock.setTimeSettings, the clock
will count upwards, otherwise the time settings with main and/or
- byoyomi time are used. The time unit is milliseconds.
-*/
+ byoyomi time are used. The time unit is milliseconds. */
public final class Clock
implements ConstClock
{
@@ -36,8 +35,7 @@ public long currentTimeMillis()
/** Listener to clock changes.
This function will be called from a different thread at regular
- intervals.
- */
+ intervals. */
public interface Listener
{
void clockChanged();
@@ -55,8 +53,7 @@ public Clock(TimeSource timeSource)
}
/** Get moves left.
- Requires: getUseByoyomi() and isInByoyomi(color)
- */
+ Requires: getUseByoyomi() and isInByoyomi(color) */
public int getMovesLeft(GoColor color)
{
assert getUseByoyomi() && isInByoyomi(color);
@@ -64,8 +61,7 @@ public int getMovesLeft(GoColor color)
}
/** Get time left.
- Requires: isInitialized()
- */
+ Requires: isInitialized() */
public long getTimeLeft(GoColor color)
{
assert isInitialized();
@@ -109,8 +105,7 @@ public String getTimeString(GoColor color)
/** Format time left to a string.
If movesLeft &lt; 0, only the time will be returned, otherwise
after the time string, a slash and the number of moves left will be
- appended.
- */
+ appended. */
public static String getTimeString(double timeLeft, int movesLeft)
{
StringBuilder buffer = new StringBuilder(8);
@@ -124,8 +119,7 @@ public static String getTimeString(double timeLeft, int movesLeft)
}
/** Return color the clock is currently measuring the time for.
- Returns null, if clock is between a #stopMove and #startMove.
- */
+ Returns null, if clock is between a #stopMove and #startMove. */
public GoColor getToMove()
{
return m_toMove;
@@ -180,8 +174,7 @@ public boolean lostOnTime(GoColor color)
/** Parses a time string.
The expected format is <tt>[[H:]MM:]SS</tt>.
@return The time in milliseconds or -1, if the time string is not
- valid.
- */
+ valid. */
public static long parseTimeString(String s)
{
String a[] = s.split(":");
@@ -258,8 +251,7 @@ public void resume()
Only one listener supported at the moment.
If the clock has a listener, the clock should be stopped with halt()
if it is no longer used, otherwise the timer thread can keep an
- application from terminating.
- */
+ application from terminating. */
public void setListener(Listener listener)
{
m_listener = listener;
@@ -268,8 +260,7 @@ public void setListener(Listener listener)
/** Set time settings.
Changing the time settings does not change the current state of the
clock. The time settings are only used when the clock is reset or
- the next byoyomi period is initialized.
- */
+ the next byoyomi period is initialized. */
public void setTimeSettings(TimeSettings settings)
{
m_timeSettings = settings;
@@ -278,8 +269,7 @@ public void setTimeSettings(TimeSettings settings)
/** Set time left.
@param color Color to set the time for.
@param time New value for time left.
- @param movesLeft -1, if not in byoyomi.
- */
+ @param movesLeft -1, if not in byoyomi. */
public void setTimeLeft(GoColor color, long time, int movesLeft)
{
halt();
@@ -304,8 +294,7 @@ public void setTimeLeft(GoColor color, long time, int movesLeft)
/** Start time for a move.
If the clock was already running, the passed time for the current move
- is discarded.
- */
+ is discarded. */
public void startMove(GoColor color)
{
assert color.isBlackWhite();
@@ -318,8 +307,7 @@ public void startMove(GoColor color)
/** Stop time for a move.
If the clock was running, the time for the move is added to the
total time for the color the clock was running for; otherwise
- this function does nothing.
- */
+ this function does nothing. */
public void stopMove()
{
if (! m_isRunning)
View
3  src/net/sf/gogui/game/ConstClock.java
@@ -5,8 +5,7 @@
import net.sf.gogui.go.GoColor;
/** Const functions of game.Clock.
- @see Clock
-*/
+ @see Clock */
public interface ConstClock
{
int getMovesLeft(GoColor color);
View
3  src/net/sf/gogui/game/ConstGame.java
@@ -6,8 +6,7 @@
import net.sf.gogui.go.GoColor;
/** Const functions of game.Game.
- @see Game
-*/
+ @see Game */
public interface ConstGame
{
ConstBoard getBoard();
View
3  src/net/sf/gogui/game/ConstGameInfo.java
@@ -7,8 +7,7 @@
import net.sf.gogui.go.Score.ScoringMethod;
/** Const functions of game.GameInfo.
- @see GameInfo
-*/
+ @see GameInfo */
public interface ConstGameInfo
{
String get(StringInfo type);
View
3  src/net/sf/gogui/game/ConstGameTree.java
@@ -3,8 +3,7 @@
package net.sf.gogui.game;
/** Const functions of game.GameTree.
- @see GameTree
-*/
+ @see GameTree */
public interface ConstGameTree
{
int getBoardSize();
View
3  src/net/sf/gogui/game/ConstNode.java
@@ -9,8 +9,7 @@
import net.sf.gogui.go.Move;
/** Const functions of game.Node.
- @see Node
-*/
+ @see Node */
public interface ConstNode
{
String getComment();
View
3  src/net/sf/gogui/game/ConstSgfProperties.java
@@ -5,8 +5,7 @@
import java.util.ArrayList;
/** Const functions of game.SgfProperties.
- @see SgfProperties
-*/
+ @see SgfProperties */
public interface ConstSgfProperties
{
int getNumberValues(String key);
View
24 src/net/sf/gogui/game/Game.java
@@ -46,8 +46,7 @@ public void addMarked(GoPoint point, MarkType type)
/** Clear modified flag.
Can be used for instance after game was saved.
- @see #isModified()
- */
+ @see #isModified() */
public void clearModified()
{
m_modified = false;
@@ -55,8 +54,7 @@ public void clearModified()
/** Append new empty node and make it current node.
Can be use for instance to prepare for setup stones if current node
- contains a move.
- */
+ contains a move. */
public void createNewChild()
{
Node node = new Node();
@@ -134,8 +132,7 @@ public void haltClock()
}
/** Return last node when startClock() was called.
- @return The last such node or null, if the clock was never running.
- */
+ @return The last such node or null, if the clock was never running. */
public ConstNode getClockNode()
{
return m_clockNode;
@@ -161,8 +158,7 @@ public final void init(GameTree tree)
/** Check if game was modified.
@return true, if game was mofified since constructor or last call to
- one of the init() functions or to clearModified().
- */
+ one of the init() functions or to clearModified(). */
public boolean isModified()
{
return m_modified;
@@ -241,8 +237,7 @@ public void resumeClock()
/** Set clock listener.
If the clock has a listener, the clock should be stopped with
haltClock() if it is no longer used, otherwise the timer thread can
- keep an application from terminating.
- */
+ keep an application from terminating. */
public void setClockListener(Clock.Listener listener)
{
m_clock.setListener(listener);
@@ -318,8 +313,7 @@ public void setToMove(GoColor color)
}
/** Change the time settings.
- If the current node is the root node, the clock will also be reset.
- */
+ If the current node is the root node, the clock will also be reset. */
public void setTimeSettings(TimeSettings timeSettings)
{
Node node = m_tree.getGameInfoNode(m_current);
@@ -353,8 +347,7 @@ public void setMovesLeft(ConstNode node, GoColor c, int moves)
/** Set a stone on the board or remove a stone.
@param p The location.
- @param c The color of the stone (EMPTY for removal).
- */
+ @param c The color of the stone (EMPTY for removal). */
public void setup(GoPoint p, GoColor c)
{
assert p != null;
@@ -383,8 +376,7 @@ public void startClock()
}
/** Truncate current node and subtree.
- New current node is the father of the old current node.
- */
+ New current node is the father of the old current node. */
public void truncate()
{
Node father = m_current.getFather();
View
15 src/net/sf/gogui/game/GameInfo.java
@@ -17,8 +17,7 @@
import net.sf.gogui.util.StringUtil;
/** Game information.
- Contains information about handicap, rules and players.
-*/
+ Contains information about handicap, rules and players. */
public class GameInfo
implements ConstGameInfo
{
@@ -84,8 +83,7 @@ public int getHandicap()
}
/** Get komi.
- @return The komi or null if komi is unknown.
- */
+ @return The komi or null if komi is unknown. */
public Komi getKomi()
{
return m_komi;
@@ -98,8 +96,7 @@ public TimeSettings getTimeSettings()
/** Hash code dummy function (don't use).
This class is not desgined to be used in a HashMap/HashTable. The
- function will trigger an assertion if assertions are enabled.
- */
+ function will trigger an assertion if assertions are enabled. */
public int hashCode()
{
assert false : "hashCode not designed";
@@ -114,8 +111,7 @@ public boolean isEmpty()
/** Try to parse rules.
@return Score.ScoringMethod.TERRITORY if rules string (to lowercase)
- is "japanese", Score.ScoringMethod.AREA otherwise.
- */
+ is "japanese", Score.ScoringMethod.AREA otherwise. */
public ScoringMethod parseRules()
{
ScoringMethod result = AREA;
@@ -170,8 +166,7 @@ public void setTimeSettings(TimeSettings timeSettings)
/** Suggest a game name from the player names.
@return A game name built from the player names or null, if not at
- least one player name is known.
- */
+ least one player name is known. */
public String suggestGameName()
{
String playerBlack = get(StringInfoColor.NAME, BLACK);
View
12 src/net/sf/gogui/game/GameTree.java
@@ -14,8 +14,7 @@
Note that the tree can have different GameInfo objects for different
subtrees to allow the representation of trees loaded from SGF. Creating
trees with multiple GameInfo objects is not not actively supported
- in GoGui, because they cannot be saved in (Jago's) XML format.
-*/
+ in GoGui, because they cannot be saved in (Jago's) XML format. */
public class GameTree
implements ConstGameTree
{
@@ -65,8 +64,7 @@ public int getBoardSize()
/** Find the game information valid for this node.
@return The game information from the nearest ancestor node,
which has a game information (the root node is always guaranteed
- to have one).
- */
+ to have one). */
public GameInfo getGameInfo(ConstNode node)
{
assert NodeUtil.getRoot(node) == getRoot();
@@ -75,8 +73,7 @@ public GameInfo getGameInfo(ConstNode node)
/** Find the node with game information valid for this node.
@return The nearest ancestor node which has a game information
- (the root node is always guaranteed to have one).
- */
+ (the root node is always guaranteed to have one). */
public Node getGameInfoNode(ConstNode node)
{
assert NodeUtil.getRoot(node) == getRoot();
@@ -92,8 +89,7 @@ public ConstGameInfo getGameInfoConst(ConstNode node)
}
/** Get a non-const reference to a const node.
- Requires: node is part of this game tree.
- */
+ Requires: node is part of this game tree. */
public Node getNode(ConstNode node)
{
assert NodeUtil.getRoot(node) == getRoot();
View
3  src/net/sf/gogui/game/MarkType.java
@@ -16,8 +16,7 @@
/** Selected (SGF markup type SL).
Not that this markup cannot be saved in (Jago's) XML (only using a
legacy SGF tag), so it is needed to display markup read from SGF,
- but is not actively supported in GoGui.
- */
+ but is not actively supported in GoGui. */
SELECT,
TERRITORY_BLACK,
View
156 src/net/sf/gogui/game/Node.java
@@ -22,15 +22,13 @@
/** Extended info.
Contains markups and value, because these are used in the large SGF
- search traces of Explorer.
-*/
+ search traces of Explorer. */
final class ExtraInfo
{
public Map<MarkType,PointList> m_marked;
/** Node value.
- Float instead of double for space efficiency.
- */
+ Float instead of double for space efficiency. */
public float m_value = Float.NaN;
public MoreExtraInfo m_moreExtraInfo;
@@ -44,8 +42,7 @@ public boolean isEmpty()
}
/** More extended info.
- Contains all the information typically not in large SGF traces.
-*/
+ Contains all the information typically not in large SGF traces. */
final class MoreExtraInfo
{
public SetupInfo m_setupInfo;
@@ -73,8 +70,7 @@ public boolean isEmpty()
public GoColor m_player;
/** Stones added or removed.
- The array is indexed by Black, White, Empty.
- */
+ The array is indexed by Black, White, Empty. */
public BlackWhiteEmptySet<PointList> m_stones
= new BlackWhiteEmptySet<PointList>(new PointList(), new PointList(),
new PointList());
@@ -106,8 +102,7 @@ public boolean isEmpty()
/** Node in a game tree.
The memory requirement is optimized for nodes containing only a move and
comment property (e.g. for GNU Go's large SGF traces).
- The optimization also expects that most nodes have only one child.
-*/
+ The optimization also expects that most nodes have only one child. */
public final class Node
implements ConstNode
{
@@ -117,16 +112,14 @@ public Node()
}
/** Construct node containing a move.
- @param move The move to store in this node.
- */
+ @param move The move to store in this node. */
public Node(Move move)
{
m_move = move;
}
/** Append a node as a child to this node.
- @param node The node to append.
- */
+ @param node The node to append. */
@SuppressWarnings("unchecked")
public void append(Node node)
{
@@ -154,8 +147,7 @@ public void append(Node node)
/** Add a markup.
@param point The location that should be marked.
- @param type The type of the markup from Node.MARK_TYPES.
- */
+ @param type The type of the markup from Node.MARK_TYPES. */
public void addMarked(GoPoint point, MarkType type)
{
assert point != null;
@@ -181,8 +173,7 @@ else if (! pointList.contains(point))
SGF properties, so that the old value is preserved if no new value
is set in GameInfo.
@param label The name of the property
- @param values The values of the property
- */
+ @param values The values of the property */
public void addSgfProperty(String label, ArrayList<String> values)
{
createSgfProperties().add(label, values);
@@ -197,8 +188,7 @@ public void addSgfProperty(String label, String value)
It is not checked, if this stone is already in the list of added
or removed stones.
@param c The color of the stone (Black or White; Empty for removal).
- @param p The location of the setup stone.
- */
+ @param p The location of the setup stone. */
public void addStone(GoColor c, GoPoint p)
{
assert p != null;
@@ -209,8 +199,7 @@ public void addStone(GoColor c, GoPoint p)
It is not checked, if this stone is already in the list of added
or removed stones.
@param c The color of the stone (Black or White; Empty for removal).
- @param list The locations of the setup stones.
- */
+ @param list The locations of the setup stones. */
public void addStones(GoColor c, ConstPointList list)
{
assert list != null;
@@ -227,8 +216,7 @@ public GameInfo createGameInfo()
}
/** Child of main variation or null if no child.
- @return Node with index 0 or null, if no children.
- */
+ @return Node with index 0 or null, if no children. */
public Node getChild()
{
if (! hasChildren())
@@ -237,8 +225,7 @@ public Node getChild()
}
/** Child of main variation or null if no child (const).
- @return Node with index 0 or null, if no children.
- */
+ @return Node with index 0 or null, if no children. */
public ConstNode getChildConst()
{
return getChild();
@@ -246,8 +233,7 @@ public ConstNode getChildConst()
/** Get child node.
@param i Index of the child in [0...getNumberChildren() - 1]
- @return The child node
- */
+ @return The child node */
public Node getChild(int i)
{
if (getNumberChildren() == 1)
@@ -257,8 +243,7 @@ public Node getChild(int i)
/** Get child node (const).
@param i Index of the child in [0...getNumberChildren() - 1]
- @return The child node
- */
+ @return The child node */
public ConstNode getChildConst(int i)
{
return getChild(i);
@@ -266,8 +251,7 @@ public ConstNode getChildConst(int i)
/** Get index of child node.
@param child The child.
- @return Index of child or -1, if node is not a child of this node.
- */
+ @return Index of child or -1, if node is not a child of this node. */
public int getChildIndex(ConstNode child)
{
for (int i = 0; i < getNumberChildren(); ++i)
@@ -278,8 +262,7 @@ public int getChildIndex(ConstNode child)
/** Get comment.
@return Comment stored in this node or null, if node contains no
- comment.
- */
+ comment. */
public String getComment()
{
if (m_comment == null)
@@ -295,16 +278,14 @@ public String getComment()
}
/** Get father node.
- @return Father node of this node or null, if no father.
- */
+ @return Father node of this node or null, if no father. */
public Node getFather()
{
return m_father;
}
/** Get father node (const).
- @return Father node of this node or null, if no father.
- */
+ @return Father node of this node or null, if no father. */
public ConstNode getFatherConst()
{
return m_father;
@@ -324,8 +305,7 @@ public ConstGameInfo getGameInfoConst()
/** Get label for a location on the board.
@param point The location.
- @return Label at location or null, if no label.
- */
+ @return Label at location or null, if no label. */
public String getLabel(GoPoint point)
{
Map<GoPoint,String> map = getLabels();
@@ -335,8 +315,7 @@ public String getLabel(GoPoint point)
}
/** Get all labels on the board.
- @return Map containing (Point,String) pairs.
- */
+ @return Map containing (Point,String) pairs. */
public Map<GoPoint,String> getLabels()
{
if (m_extraInfo == null || m_extraInfo.m_moreExtraInfo == null)
@@ -355,8 +334,7 @@ public String getLabel(GoPoint point)
/** Get all markups of a type.
@param type Markup type from Node.MARK_TYPES.
- @return Map containing (Point,String) pairs.
- */
+ @return Map containing (Point,String) pairs. */
public PointList getMarked(MarkType type)
{
if (m_extraInfo == null || m_extraInfo.m_marked == null)
@@ -366,16 +344,14 @@ public PointList getMarked(MarkType type)
/** Get all markups of a type (const).
@param type Markup type from Node.MARK_TYPES.
- @return Map containing (Point,String) pairs.
- */
+ @return Map containing (Point,String) pairs. */
public ConstPointList getMarkedConst(MarkType type)
{
return getMarked(type);
}
/** Get move contained in this node.
- @return Move or null, if no move.
- */
+ @return Move or null, if no move. */
public Move getMove()
{
return m_move;
@@ -384,8 +360,7 @@ public Move getMove()
/** Moves left in byoyomi.
@param c The color.
@return Moves left in byoyomi for that color or -1 if not in byoyomi or
- unknown.
- */
+ unknown. */
public int getMovesLeft(GoColor c)
{
assert c.isBlackWhite();
@@ -396,8 +371,7 @@ public int getMovesLeft(GoColor c)
}
/** Get number of children.
- @return Number of children.
- */
+ @return Number of children. */
public int getNumberChildren()
{
if (m_children == null)
@@ -409,8 +383,7 @@ public int getNumberChildren()
/** Color to play if explicitely set.
@see #getToMove for getting the color to play.
- @return Color to play or null if color is not explicitely set.
- */
+ @return Color to play or null if color is not explicitely set. */
public GoColor getPlayer()
{
SetupInfo setupInfo = getSetupInfo();
@@ -421,8 +394,7 @@ public GoColor getPlayer()
/** Get setup stones.
@param c Color of the stones; EMPTY for removed stones.
- @return The added or removed stones.
- */
+ @return The added or removed stones. */
public ConstPointList getSetup(GoColor c)
{
SetupInfo setupInfo = getSetupInfo();
@@ -434,8 +406,7 @@ public ConstPointList getSetup(GoColor c)
/** Get other unspecified SGF properties.
@return The map with other SGF properties mapping String label
to String value
- @see #addSgfProperty
- */
+ @see #addSgfProperty */
public SgfProperties getSgfProperties()
{
if (m_extraInfo == null || m_extraInfo.m_moreExtraInfo == null)
@@ -446,8 +417,7 @@ public SgfProperties getSgfProperties()
/** Get other unspecified SGF properties (const).
@return The map with other SGF properties mapping String label
to String value
- @see #addSgfProperty
- */
+ @see #addSgfProperty */
public ConstSgfProperties getSgfPropertiesConst()
{
return getSgfProperties();
@@ -455,8 +425,7 @@ public ConstSgfProperties getSgfPropertiesConst()
/** Time left for color after move was made.
@param c The color
- @return Time left in seconds for this color or Double.NaN if unknown
- */
+ @return Time left in seconds for this color or Double.NaN if unknown */
public double getTimeLeft(GoColor c)
{
assert c.isBlackWhite();
@@ -470,8 +439,7 @@ public double getTimeLeft(GoColor c)
If a player is explicitely set, it is returned, otherwise if the
node contains a move, the color of the move is returned.
@return The color to move or null if nothing is known about
- the color to move
- */
+ the color to move */
public GoColor getToMove()
{
GoColor player = getPlayer();
@@ -484,8 +452,7 @@ public GoColor getToMove()
/** Return a value for the node.
The meaning of a value is according to the SGF property V[]
- @return The value, or Float.NaN, if node contains no value
- */
+ @return The value, or Float.NaN, if node contains no value */
public float getValue()
{
if (m_extraInfo == null)
@@ -501,8 +468,7 @@ public boolean hasChildren()
/** Check if node contains a comment.
More efficient than #getComment(), because getComment decodes the
comment into a String, if it exists.
- @return true if node contains a comment
- */
+ @return true if node contains a comment */
public boolean hasComment()
{
return (m_comment != null);
@@ -514,8 +480,7 @@ public boolean hasFather()
}
/** Check if node has setup or delete stones.
- @return true, if node has setup or delete stones.
- */
+ @return true, if node has setup or delete stones. */
public boolean hasSetup()
{
for (GoColor c : BLACK_WHITE_EMPTY)
@@ -526,8 +491,7 @@ public boolean hasSetup()
/** Check if node is child of this node.
@param node The node to check.
- @return true, if node is child node.
- */
+ @return true, if node is child node. */
public boolean isChildOf(Node node)
{
return (node.getChildIndex(this) != -1);
@@ -541,8 +505,7 @@ public boolean isEmpty()
}
/** Make child the first child of this node.
- @param child One of the child nodes of this node.
- */
+ @param child One of the child nodes of this node. */
@SuppressWarnings("unchecked")
public void makeMainVariation(Node child)
{
@@ -555,8 +518,7 @@ public void makeMainVariation(Node child)
}
/** Remove child of this node.
- @param child Child to remove.
- */
+ @param child Child to remove. */
public void removeChild(Node child)
{
assert child.isChildOf(this);
@@ -577,8 +539,7 @@ else if (numberChildren >= 2)
/** Remove markup.
@param point Location of the markup.
- @param type Type of the markup from Node.MARK_TYPES.
- */
+ @param type Type of the markup from Node.MARK_TYPES. */
public void removeMarked(GoPoint point, MarkType type)
{
assert point != null;
@@ -590,8 +551,7 @@ public void removeMarked(GoPoint point, MarkType type)
/** Remove setup at point.
Remove any setup that was added with #addStone at a point.
- @param p Location of the setup.
- */
+ @param p Location of the setup. */
public void removeSetup(GoPoint p)
{
assert p != null;
@@ -614,8 +574,7 @@ public void removeVariations()
/** Store comment in this node.
@param comment The comment. If the parameter is null, empty or
contains only whitespaces, then the comment will be deleted from this
- node.
- */
+ node. */
public void setComment(String comment)
{
if (StringUtil.isEmpty(comment))
@@ -634,8 +593,7 @@ public void setComment(String comment)
}
/** Set father of this node.
- @param father The new father.
- */
+ @param father The new father. */
public void setFather(Node father)
{
m_father = father;
@@ -645,8 +603,7 @@ public void setFather(Node father)
Whitespaces will be trimmed.
@param point The location.
@param label The text of the label; empty string or null to delete
- the label.
- */
+ the label. */
public void setLabel(GoPoint point, String label)
{
assert point != null;
@@ -661,8 +618,7 @@ public void setLabel(GoPoint point, String label)
}
/** Set move stored in this node.
- @param move The move or null, if no move.
- */
+ @param move The move or null, if no move. */
public void setMove(Move move)
{
m_move = move;
@@ -670,8 +626,7 @@ public void setMove(Move move)
/** Set byoyomi moves left.
@param c The player.
- @param n Number of moves left.
- */
+ @param n Number of moves left. */
public void setMovesLeft(GoColor c, int n)
{
assert c.isBlackWhite();
@@ -680,8 +635,7 @@ public void setMovesLeft(GoColor c, int n)
/** Set byoyomi time left.
@param c The player.
- @param seconds Time left in seconds.
- */
+ @param seconds Time left in seconds. */
public void setTimeLeft(GoColor c, double seconds)
{
assert c.isBlackWhite();
@@ -689,8 +643,7 @@ public void setTimeLeft(GoColor c, double seconds)
}
/** Explicitely set color to play.
- @param color Color to play.
- */
+ @param color Color to play. */
public void setPlayer(GoColor color)
{
assert color.isBlackWhite();
@@ -699,8 +652,7 @@ public void setPlayer(GoColor color)
/** Set value for this node.
@see #getValue()
- @param value The value
- */
+ @param value The value */
public void setValue(float value)
{
createExtraInfo();
@@ -709,8 +661,7 @@ public void setValue(float value)
/** Sort the lists of setup stones (add stones and remove stones.
Sorted lists for setup stones make it easier to compare, if
- two nodes have the same lists.
- */
+ two nodes have the same lists. */
public void sortSetup()
{
for (GoColor c : BLACK_WHITE_EMPTY)
@@ -720,8 +671,7 @@ public void sortSetup()
/** Return next child after a given child.
@param child The child
- @return The next child or null, if there is no next child
- */
+ @return The next child or null, if there is no next child */
public ConstNode variationAfter(ConstNode child)
{
int numberChildren = getNumberChildren();
@@ -738,8 +688,7 @@ public ConstNode variationAfter(ConstNode child)
/** Return previous child before a given child.
@param child The child
- @return The previous child or null, if there is no previous child
- */
+ @return The previous child or null, if there is no previous child */
public ConstNode variationBefore(ConstNode child)
{
int numberChildren = getNumberChildren();
@@ -756,8 +705,7 @@ public ConstNode variationBefore(ConstNode child)
/** Comment stored as bytes.
Store comments in UTF-8, because that saves up to a factor of 2 in
- size compared to a string.
- */
+ size compared to a string. */
private byte[] m_comment;
private ExtraInfo m_extraInfo;
View
83 src/net/sf/gogui/game/NodeUtil.java
@@ -27,8 +27,7 @@
@param n The number of moves to go backward.
@return The node reached by going n moves backward or the root node
of the tree, if there are less than n nodes in the sequence before
- the start node.
- */
+ the start node. */
public static ConstNode backward(ConstNode node, int n)
{
assert n >= 0;
@@ -45,8 +44,7 @@ public static ConstNode backward(ConstNode node, int n)
Handles the following properties: TM (because FF3 allowed an arbitrary
text in TM), OT (FF4 allows arbitrary text)
@return The cleaned properties, empty properties, if
- node.getSgfProperties() was null
- */
+ node.getSgfProperties() was null */
public static SgfProperties cleanSgfProps(ConstNode node)
{
SgfProperties props = new SgfProperties(node.getSgfPropertiesConst());
@@ -68,8 +66,7 @@ public static SgfProperties cleanSgfProps(ConstNode node)
@param node The node to check.
@param pattern The pattern.
@return <tt>true</tt>, if the current node has a comment and a match
- for the pattern is found in the comment.
- */
+ for the pattern is found in the comment. */
public static boolean commentContains(ConstNode node, Pattern pattern)
{
String comment = node.getComment();
@@ -81,8 +78,7 @@ public static boolean commentContains(ConstNode node, Pattern pattern)
@param node The given node.
@param moveNumber The move number of the wanted node.
@return The node with the given move number or <code>null</code> if
- no such node exists.
- */
+ no such node exists. */
public static ConstNode findByMoveNumber(ConstNode node, int moveNumber)
{
int maxMoveNumber = getMoveNumber(node) + getMovesLeft(node);
@@ -113,8 +109,7 @@ public static ConstNode findByMoveNumber(ConstNode node, int moveNumber)
@return The first node of the given variation, or the root node,
if the variation string is empty, or <code>null</code>, if the
variation string is invalid or does not specify a node in the
- given tree.
- */
+ given tree. */
public static ConstNode findByVariation(ConstNode root, String variation)
{
if (variation.trim().equals(""))
@@ -155,8 +150,7 @@ public static ConstNode findByVariation(ConstNode root, String variation)
@param node The current node in the iteration.
@param pattern The pattern.
@return The next node in the iteration through the complete tree
- after the current node that contains a match of the pattern.
- */
+ after the current node that contains a match of the pattern. */
public static ConstNode findInComments(ConstNode node, Pattern pattern)
{
node = nextNode(node);
@@ -172,8 +166,7 @@ public static ConstNode findInComments(ConstNode node, Pattern pattern)
/** Find next node with a comment in the iteration through complete tree.
@param node The current node in the iteration.
@return The next node in the iteration through the complete tree
- after the current node that has a comment.
- */
+ after the current node that has a comment. */
public static ConstNode findNextComment(ConstNode node)
{
node = nextNode(node);
@@ -191,8 +184,7 @@ public static ConstNode findNextComment(ConstNode node)
@param n The number of moves to go forward.
@return The node reached by going n moves forward following the main
variaton (always the first child) or the last node in this variation,
- if it has less than n nodes.
- */
+ if it has less than n nodes. */
public static ConstNode forward(ConstNode node, int n)
{
assert n >= 0;
@@ -216,8 +208,7 @@ public static ConstNode getBackToMainVariation(ConstNode node)
/** Get all children moves.
@return Point list containing the move points, not including passes
- and independent of color.
- */
+ and independent of color. */
public static PointList getChildrenMoves(ConstNode node)
{
PointList moves = new PointList();
@@ -231,8 +222,7 @@ public static PointList getChildrenMoves(ConstNode node)
}
/** Get child node containing a certain move.
- @return null if no such child exists.
- */
+ @return null if no such child exists. */
public static ConstNode getChildWithMove(ConstNode node, Move move)
{
for (int i = 0; i < node.getNumberChildren(); ++i)
@@ -247,8 +237,7 @@ public static ConstNode getChildWithMove(ConstNode node, Move move)
/** Get comment, but no more than a maximum number of characters.
@return Start of comment, with ellipses appended if trunceted;
- null, if node has no comment.
- */
+ null, if node has no comment. */
public static String getCommentStart(ConstNode node,
boolean firstLineOnly,
int maxChar)
@@ -293,8 +282,7 @@ public static String getCommentStart(ConstNode node,
@param node The node.
@return The number of nodes in the sequence from the root node
to the given node, excluding the given node (which means that the
- root node has depth 0).
- */
+ root node has depth 0). */
public static int getDepth(ConstNode node)
{
int depth = 0;
@@ -317,8 +305,7 @@ public static ConstNode getLast(ConstNode node)
/** Get the move number of a node.
@param node The node.
@return The total number of moves in the sequence of nodes from
- the root node to the given node, including the given node.
- */
+ the root node to the given node, including the given node. */
public static int getMoveNumber(ConstNode node)
{
int moveNumber = 0;
@@ -384,8 +371,7 @@ public static int getNodesLeft(ConstNode node)
/** Get nodes in path from a given node to the root node.
@param node The node
@param result The resulting path. Passed as an argument to allow
- reusing an array list. It will be cleared before it is used.
- */
+ reusing an array list. It will be cleared before it is used. */
public static void getPathToRoot(ConstNode node,
ArrayList<ConstNode> result)
{
@@ -428,8 +414,7 @@ public static ConstNode getPreviousEarlierVariation(ConstNode node)
/** Get the root node.
@param node The node.
- @return The root node of the tree that the given node belongs to.
- */
+ @return The root node of the tree that the given node belongs to. */
public static ConstNode getRoot(ConstNode node)
{
while (node.getFatherConst() != null)
@@ -441,8 +426,7 @@ public static ConstNode getRoot(ConstNode node)
The string contains the number of the child for each node with more
than one child in the path from the root node to this node.
The childs are counted starting with 1 and the numbers are separated
- by colons.
- */
+ by colons. */
public static String getVariationString(ConstNode node)
{
ArrayList<String> list = new ArrayList<String>();
@@ -475,8 +459,7 @@ public static boolean hasSubtree(ConstNode node)
}
/** Check if game is in cleanup stage.
- Cleanup stage is after two consecutive pass moves have been played.
- */
+ Cleanup stage is after two consecutive pass moves have been played. */
public static boolean isInCleanup(ConstNode node)
{
boolean lastPass = false;
@@ -503,8 +486,7 @@ public static boolean isInCleanup(ConstNode node)
@param node The node.
@return <tt>true</tt>, if the given node is in the main variation,
which is the sequence of nodes starting from the root of the tree
- and always following the first child.
- */
+ and always following the first child. */
public static boolean isInMainVariation(ConstNode node)
{
while (node.getFatherConst() != null)
@@ -518,8 +500,8 @@ public static boolean isInMainVariation(ConstNode node)
/** Check if node is root node and has no children.
@param node The node to check.
- @return <tt>true</tt>, if the node has no father node and no children.
- */
+ @return <tt>true</tt>, if the node has no father node and no
+ children. */
public static boolean isRootWithoutChildren(ConstNode node)
{
return (! node.hasFather() && ! node.hasChildren());
@@ -530,8 +512,7 @@ public static boolean isRootWithoutChildren(ConstNode node)
move of the given color also contains information about the time left
after the move for the color. If a previous node with a game info
containing time settings exists and no move of the given color was
- played since then, the function also returns true.
- */
+ played since then, the function also returns true. */
public static boolean isTimeLeftKnown(ConstNode node, GoColor color)
{
while (node != null)
@@ -553,8 +534,7 @@ public static boolean isTimeLeftKnown(ConstNode node, GoColor color)
node to the current node (exclusive the current node), such that all
nodes in the sequence (inclusive the current node) are the first
child of their parents.
- @param node The current node.
- */
+ @param node The current node. */
public static void makeMainVariation(Node node)
{
while (node.getFatherConst() != null)
@@ -605,8 +585,7 @@ public static ConstNode nextNode(ConstNode node, int depth)
/** Return a string containing information about a node.
The string contains a listing of the data stored in the node
(like moves or setup stones) and properties of the node in the
- tree (like depth or variation).
- */
+ tree (like depth or variation). */
public static String nodeInfo(ConstNode node)
{
StringBuilder buffer = new StringBuilder(128);
@@ -715,8 +694,7 @@ public static String nodeInfo(ConstNode node)
Updates the clock from the time left information stored in the nodes
of the sequence from the root node to the current node.
@param node The current node.
- @param clock The clock to update.
- */
+ @param clock The clock to update. */
public static void restoreClock(ConstNode node, Clock clock)
{
clock.reset();
@@ -736,8 +714,7 @@ public static void restoreClock(ConstNode node, Clock clock)
@param minDepth The minimum depth of the interval (inclusive)
@param maxDepth The maximum depth of the interval (inclusive)
@return A random node in the given depth interval, null, if there is
- none.
- */
+ none. */
public static ConstNode selectRandom(ConstNode root, int minDepth,
int maxDepth)
{
@@ -755,8 +732,7 @@ public static ConstNode selectRandom(ConstNode root, int minDepth,
}
/** Check if the number of nodes in the subtree of a node is greater
- than a given limit.
- */
+ than a given limit. */
public static boolean subtreeGreaterThan(ConstNode node, int size)
{
int n = 0;
@@ -773,8 +749,8 @@ public static boolean subtreeGreaterThan(ConstNode node, int size)
/** Count number of nodes in subtree.
@param node The root node of the subtree.
- @return The number of nodes in the subtree (including the root node).
- */
+ @return The number of nodes in the subtree (including the root
+ node). */
public static int subtreeSize(ConstNode node)
{
int n = 0;
@@ -788,8 +764,7 @@ public static int subtreeSize(ConstNode node)
}
/** Return a string containing information and statistics of the subtree
- of a node.
- */
+ of a node. */
public static String treeInfo(ConstNode node)
{
int numberNodes = 0;
View
6 src/net/sf/gogui/game/SgfProperties.java
@@ -10,8 +10,7 @@
Non-type-checked SGF properties for preserving unknown properties.
Should only be used for unknown properties.
@todo Iteration is inefficient, reimplement (but without sacrificing
- const-correctness)
-*/
+ const-correctness) */
public final class SgfProperties
implements ConstSgfProperties
{
@@ -43,8 +42,7 @@ public void add(String key, String value)
}
/** Get a list of all keys.
- This list is a copy of the keys at the time of the function call.
- */
+ This list is a copy of the keys at the time of the function call. */
public ArrayList<String> getKeys()
{
return new ArrayList<String>(m_properties.keySet());
View
27 src/net/sf/gogui/game/TimeSettings.java
@@ -10,13 +10,11 @@
have a number of moves assigned, which need to be played during an
overtime period. The base time can be zero. If no overtime periods are
used, the whole game must be finished in the base time.
- This class is immutable.
-*/
+ This class is immutable. */
public final class TimeSettings
{
/** Construct with total time for game.
- @param totalTime Total time for game in milliseconds.
- */
+ @param totalTime Total time for game in milliseconds. */
public TimeSettings(long totalTime)
{
assert totalTime > 0;
@@ -28,8 +26,7 @@ public TimeSettings(long totalTime)
/** Construct with base time and overtime.
@param preByoyomi Base time for game in milliseconds.
@param byoyomi Time for overtime period in milliseconds.
- @param byoyomiMoves Number of moves per overtime period.
- */
+ @param byoyomiMoves Number of moves per overtime period. */
public TimeSettings(long preByoyomi, long byoyomi, int byoyomiMoves)
{
assert preByoyomi >= 0;
@@ -53,8 +50,7 @@ public boolean equals(Object object)
/** Get time for overtime period.
@return Time for overtime period in milliseconds; undefined if there
- are no overtime periods in this time settings.
- */
+ are no overtime periods in this time settings. */
public long getByoyomi()
{
assert getUseByoyomi();
@@ -63,8 +59,7 @@ public long getByoyomi()
/** Get number of moves per overtime period.
@return Number of moves per overtime period; undefined if there are
- no overtime periods in this time settings.
- */
+ no overtime periods in this time settings. */
public int getByoyomiMoves()
{
assert getUseByoyomi();
@@ -73,16 +68,14 @@ public int getByoyomiMoves()
/** Get base time for game.
@return Base time for game in milliseconds; this corresponds to
- the total time for the game, if there are no overtime periods.
- */
+ the total time for the game, if there are no overtime periods. */
public long getPreByoyomi()
{
return m_preByoyomi;
}
/** Check if overtime periods are used.
- @return True, if overtime periods are used in this time settings.
- */
+ @return True, if overtime periods are used in this time settings. */
public boolean getUseByoyomi()
{
return (m_byoyomiMoves > 0);
@@ -90,8 +83,7 @@ public boolean getUseByoyomi()
/** Hash code dummy function (don't use).
This class is not desgined to be used in a HashMap/HashTable. The
- function will trigger an assertion if assertions are enabled.
- */
+ function will trigger an assertion if assertions are enabled. */
public int hashCode()
{
assert false : "hashCode not designed";
@@ -106,8 +98,7 @@ The base time and overtime (byoyomi) can have an optional unit
minutes).
@param s The string.
@return TimeSettings The time settings corresponding to this string.
- @throws ErrorMessage On syntax error or invalid values.
- */
+ @throws ErrorMessage On syntax error or invalid values. */
public static TimeSettings parse(String s) throws ErrorMessage
{
boolean useByoyomi = false;
View
3  src/net/sf/gogui/gamefile/GameFileFilter.java
@@ -13,8 +13,7 @@
{
/** Accept function.
@param file The file to check.
- @return true if file has extension .sgf or .SGF or is a directory
- */
+ @return true if file has extension .sgf or .SGF or is a directory */
public boolean accept(File file)
{
if (file.isDirectory())
View
3  src/net/sf/gogui/gamefile/GameFileUtil.java
@@ -18,8 +18,7 @@
@return Position of main variation before that move number or last
position if game has less moves (same convention as in the loadsgf GTP
command).
- @throws ErrorMessage If loading fails.
- */
+ @throws ErrorMessage If loading fails. */
public static ConstBoard load(File file, int maxMove) throws ErrorMessage
{
GameReader reader = new GameReader(file);
View
3  src/net/sf/gogui/gamefile/GameReader.java
@@ -20,8 +20,7 @@
public class GameReader
{
/** Construct reader and read a game.
- @param progressShow Callback to show progress, can be null
- */
+ @param progressShow Callback to show progress, can be null */
public GameReader(File file, ProgressShow progressShow) throws ErrorMessage
{
m_gameFile = new GameFile();
View
3  src/net/sf/gogui/go/BlackWhiteEmptySet.java
@@ -7,8 +7,7 @@
import static net.sf.gogui.go.GoColor.EMPTY;
/** A set containing one element for Black, one for White, and one for
- Empty.
-*/
+ Empty. */
public class BlackWhiteEmptySet<T>
{
public BlackWhiteEmptySet()
View
91 src/net/sf/gogui/go/Board.java
@@ -37,16 +37,14 @@ public void remove()
/** Constructor.
@param boardSize The board size (number of points per row / column)
- in the range from one to GoPoint.MAX_SIZE
- */
+ in the range from one to GoPoint.MAX_SIZE */
public Board(int boardSize)
{
init(boardSize);
}
/** Check for two consecutive passes.
- @return true, if the last two moves were pass moves
- */
+ @return true, if the last two moves were pass moves */
public boolean bothPassed()
{
int n = getNumberMoves();
@@ -57,8 +55,7 @@ public boolean bothPassed()
/** Check if board contains a point.
@param point The point to check
- @return true, if the point is on the board
- */
+ @return true, if the point is on the board */
public boolean contains(GoPoint point)
{
return point.isOnBoard(getSize());
@@ -66,8 +63,7 @@ public boolean contains(GoPoint point)
/** Get points adjacent to a point.
@param point The point.
- @return List of points adjacent.
- */
+ @return List of points adjacent. */
public ConstPointList getAdjacent(GoPoint point)
{
return m_constants.getAdjacent(point);
@@ -75,16 +71,14 @@ public ConstPointList getAdjacent(GoPoint point)
/** Get number of captured stones.
@return The total number of stones of the given color captured by
- opponent moves or by suicide.
- */
+ opponent moves or by suicide. */
public int getCaptured(GoColor c)
{
return m_captured.get(c);
}
/** Get state of a point on the board.
- @return BLACK, WHITE or EMPTY
- */
+ @return BLACK, WHITE or EMPTY */
public GoColor getColor(GoPoint p)
{
return m_color[p.getIndex()];
@@ -95,8 +89,7 @@ public GoColor getColor(GoPoint p)
@param size The board size.
@return List of points (go.Point) corresponding to the handicap
stone locations.
- @see BoardConstants#getHandicapStones
- */
+ @see BoardConstants#getHandicapStones */
public static ConstPointList getHandicapStones(int size, int n)
{
return BoardConstants.get(size).getHandicapStones(n);
@@ -107,8 +100,7 @@ public static ConstPointList getHandicapStones(int size, int n)
Requires that there is a last move (or setup stone).
@return List of opponent stones (go.Point) captured in last move;
empty if none were killed or there is no last move.
- @see #getSuicide()
- */
+ @see #getSuicide() */
public ConstPointList getKilled()
{
int n = getNumberMoves();
@@ -117,8 +109,7 @@ public ConstPointList getKilled()
}
/** Return last move.
- @return Last move or null if there is no last move.
- */
+ @return Last move or null if there is no last move. */
public Move getLastMove()
{
int n = getNumberMoves();
@@ -129,8 +120,7 @@ public Move getLastMove()
/** Get the number of moves played so far.
@return The number of moves.
- @see #getMove
- */
+ @see #getMove */
public int getNumberMoves()
{
return m_stack.size();
@@ -139,8 +129,7 @@ public int getNumberMoves()
/** Get a move from the sequence of moves played so far.
@param i The number of the move (starting with zero).
@return The move with the given number.
- @see #getNumberMoves()
- */
+ @see #getNumberMoves() */
public Move getMove(int i)
{
return m_stack.get(i).m_move;
@@ -150,8 +139,7 @@ public Move getMove(int i)
@param c Black or White.
@return Initial stones of this color placed on the board by calling
<code>setup</code>.
- @see #setup
- */
+ @see #setup */
public ConstPointList getSetup(GoColor c)
{
return m_setup.get(c);
@@ -160,16 +148,14 @@ public ConstPointList getSetup(GoColor c)
/** Get player of initial setup position.
@return Player of initial setup position as used in the call to
<code>setup</code>; <code>null</code> means unknown player color.
- @see #setup
- */
+ @see #setup */
public GoColor getSetupPlayer()
{
return m_setupPlayer;
}
/** Get board size.
- @return The board size.
- */
+ @return The board size. */
public int getSize()
{
return m_size;
@@ -189,8 +175,7 @@ Requires that there is a last move (or setup stone).
@return List of stones (go.Point) killed by suicide in last move,
including the stone played; empty if no stones were killed by suicide
or if there is no last move.
- @see #getKilled()
- */
+ @see #getKilled() */
public ConstPointList getSuicide()
{
int n = getNumberMoves();
@@ -199,8 +184,7 @@ public ConstPointList getSuicide()
}
/** Get color to move.
- @return The color to move.
- */
+ @return The color to move. */
public GoColor getToMove()
{
return m_toMove;
@@ -210,8 +194,7 @@ public GoColor getToMove()
For changing the board size.
Also calls clear().
@param size The new board size (number of points per
- row / column) in the range from one to GoPoint.MAX_SIZE
- */
+ row / column) in the range from one to GoPoint.MAX_SIZE */
public void init(int size)
{
m_size = size;
@@ -224,8 +207,7 @@ public void init(int size)
@param c The player color.
@param p The point to check.
@return true, if a move on the given point by the given player would
- capture any opponent stones, or be a suicide move.
- */
+ capture any opponent stones, or be a suicide move. */
public boolean isCaptureOrSuicide(GoColor c, GoPoint p)
{
if (getColor(p) != EMPTY)
@@ -239,8 +221,7 @@ public boolean isCaptureOrSuicide(GoColor c, GoPoint p)
/** Check if a point is a handicap point.
@param point The point to check.
@return true, if the given point is a handicap point.
- @see BoardConstants#isHandicap
- */
+ @see BoardConstants#isHandicap */
public boolean isHandicap(GoPoint point)
{
return m_constants.isHandicap(point);
@@ -249,8 +230,8 @@ public boolean isHandicap(GoPoint point)
/** Check if move would violate the simple Ko rule.
Assumes other color to move than the color of the last move.
@param point The point to check
- @return true, if a move at this point would violate the simple ko rule
- */
+ @return true, if a move at this point would violate the simple ko
+ rule */
public boolean isKo(GoPoint point)
{
return point == m_koPoint;
@@ -268,8 +249,7 @@ public boolean isModified()
/** Check if the initial setup position was a handicap.
@return <code>true</code>, if the initial position was setup by
calling setupHandicap, <code>false</code> otherwise.
- @see #setupHandicap
- */
+ @see #setupHandicap */
public boolean isSetupHandicap()
{
return m_isSetupHandicap;
@@ -279,8 +259,7 @@ public boolean isSetupHandicap()
@param c The player color to check.
@param p The point to check.
@return true, if a move at the given point by the given player
- would be a suicide move.
- */
+ would be a suicide move. */
public boolean isSuicide(GoColor c, GoPoint p)
{
if (getColor(p) != EMPTY)
@@ -297,8 +276,7 @@ public boolean isSuicide(GoColor c, GoPoint p)
}
/** Clear board.
- Takes back the effects of any moves or setup stones on the board.
- */
+ Takes back the effects of any moves or setup stones on the board. */
public void clear()
{
for (GoPoint p : this)
@@ -318,8 +296,7 @@ public void clear()
/** Play a move.
@param color The player who played the move.
@param point The location of the move.
- @see #play(Move)
- */
+ @see #play(Move) */
public void play(GoColor color, GoPoint point)
{
play(Move.get(color, point));
@@ -332,8 +309,7 @@ public void play(GoColor color, GoPoint point)
A move will place a stone of the given color, capture all dead
blocks adjacent to the stone, capture the block the stone is part of
if it was a suicide move and switches the color to move.
- @param move The move (location and player)
- */
+ @param move The move (location and player) */
public void play(Move move)
{
StackEntry entry = new StackEntry(move);
@@ -342,8 +318,7 @@ public void play(Move move)
}
/** Change the color to move.
- @param toMove The new color to move.
- */
+ @param toMove The new color to move. */
public void setToMove(GoColor toMove)
{
m_toMove = toMove;
@@ -353,8 +328,7 @@ public void setToMove(GoColor toMove)
Clears the board and move history and sets up a position.
@param black Black stones to add on the board.
@param white White stones to add on the board.
- @param player Color to play
- */
+ @param player Color to play */
public void setup(ConstPointList black, ConstPointList white,
GoColor player)
{
@@ -381,8 +355,7 @@ public void setup(ConstPointList black, ConstPointList white,
This function is similar to an initial setup with only black stones,
but it is remembered that the setup was a handicap and it can later
be checked with <code>isSetupHandicap</code>.
- @see #isSetupHandicap
- */
+ @see #isSetupHandicap */
public void setupHandicap(ConstPointList points)
{
setup(points, null, WHITE);
@@ -391,8 +364,7 @@ public void setupHandicap(ConstPointList points)
/** Undo the last move.
Restores any stones removed by the last move (captured or
- suicide) and the color who was to move before the move.
- */
+ suicide) and the color who was to move before the move. */
public void undo()
{
int index = getNumberMoves() - 1;
@@ -404,8 +376,7 @@ public void undo()
/** Undo a number of moves.
@param n Number of moves to undo. Must be between 0
and getNumberMoves().
- @see #undo()
- */
+ @see #undo() */
public void undo(int n)
{
assert n >= 0;
View
18 src/net/sf/gogui/go/BoardConstants.java
@@ -3,8 +3,7 @@
package net.sf.gogui.go;
/** Some values that are constant for a given board size.
- Instances of this class are immutable.
- */
+ Instances of this class are immutable. */
public final class BoardConstants
{
/** Get board constants for a given board size.
@@ -13,8 +12,7 @@
The creation is done in a thread-safe way.
@param boardSize The new board size (number of points per
row / column) in the range from one to GoPoint.MAX_SIZE
- @return The board constants.
- */
+ @return The board constants. */
public static BoardConstants get(int boardSize)
{
synchronized (s_boardConstants)
@@ -39,8 +37,7 @@ public ConstPointList getAdjacent(GoPoint p)
@return List of points (go.Point) corresponding to the handicap
stone locations; null if handicap locations are not defined for
this combination of number of handicap stones and board size; empty
- list for zero handicap stones.
- */
+ list for zero handicap stones. */
public ConstPointList getHandicapStones(int n)
{
PointList result = new PointList(9);
@@ -94,8 +91,7 @@ public int getSize()