Class 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 string
      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
      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
      static 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 key
      static 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 value
      static java.lang.String propertiesString​(java.util.Map<java.lang.String,​java.lang.String> props)
      Get properties string by the props
      static void save​(Board board, java.lang.String filename)  
      static java.lang.String saveToString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SGFParser

        public SGFParser()
    • 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: