Package featurecat.lizzie.rules
Class SGFParser
- java.lang.Object
-
- featurecat.lizzie.rules.SGFParser
-
public class SGFParser extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description SGFParser()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addProperties(java.util.Map<java.lang.String,java.lang.String> props, java.lang.String propsStr)
Add the properties from stringstatic void
addProperties(java.util.Map<java.lang.String,java.lang.String> props, java.util.Map<java.lang.String,java.lang.String> addProps)
Add the properties by mutating the propsstatic void
addProperty(java.util.Map<java.lang.String,java.lang.String> props, java.lang.String key, java.lang.String value)
Add a key and value to the propsstatic int[]
convertSgfPosToCoord(java.lang.String pos)
static java.lang.String
getOrDefault(java.util.Map<java.lang.String,java.lang.String> props, java.lang.String key, java.lang.String defaultValue)
Get a value with key, or the default if there is no such keystatic boolean
isListProperty(java.lang.String key)
static boolean
isMarkupProperty(java.lang.String key)
static boolean
load(java.lang.String filename)
static boolean
loadFromString(java.lang.String sgfString)
static java.lang.String
nodeString(java.lang.String key, java.lang.String value)
Get node string by the key and valuestatic java.lang.String
propertiesString(java.util.Map<java.lang.String,java.lang.String> props)
Get properties string by the propsstatic void
save(Board board, java.lang.String filename)
static java.lang.String
saveToString()
-
-
-
Method Detail
-
load
public static boolean load(java.lang.String filename) throws java.io.IOException
- Throws:
java.io.IOException
-
loadFromString
public static boolean loadFromString(java.lang.String sgfString)
-
convertSgfPosToCoord
public static int[] convertSgfPosToCoord(java.lang.String pos)
-
saveToString
public static java.lang.String saveToString() throws java.io.IOException
- Throws:
java.io.IOException
-
save
public static void save(Board board, java.lang.String filename) throws java.io.IOException
- Throws:
java.io.IOException
-
isListProperty
public static boolean isListProperty(java.lang.String key)
-
isMarkupProperty
public static boolean isMarkupProperty(java.lang.String key)
-
getOrDefault
public static java.lang.String getOrDefault(java.util.Map<java.lang.String,java.lang.String> props, java.lang.String key, java.lang.String defaultValue)
Get a value with key, or the default if there is no such key- Parameters:
key
-defaultValue
-- Returns:
-
addProperty
public static void addProperty(java.util.Map<java.lang.String,java.lang.String> props, java.lang.String key, java.lang.String value)
Add a key and value to the props- Parameters:
key
-value
-
-
addProperties
public static void addProperties(java.util.Map<java.lang.String,java.lang.String> props, java.util.Map<java.lang.String,java.lang.String> addProps)
Add the properties by mutating the props
-
addProperties
public static void addProperties(java.util.Map<java.lang.String,java.lang.String> props, java.lang.String propsStr)
Add the properties from string
-
propertiesString
public static java.lang.String propertiesString(java.util.Map<java.lang.String,java.lang.String> props)
Get properties string by the props- Returns:
-
nodeString
public static java.lang.String nodeString(java.lang.String key, java.lang.String value)
Get node string by the key and value- Parameters:
key
-value
-- Returns:
-
-