Class NRGameNameIO

  • All Implemented Interfaces:
    GameNameIO

    public class NRGameNameIO
    extends java.lang.Object
    implements GameNameIO
    Extracts a game name from a nr report.
    Author:
    stm
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static java.util.regex.Pattern atlantisPattern  
      protected static java.util.regex.Pattern eresseaPattern  
    • Constructor Summary

      Constructors 
      Constructor Description
      NRGameNameIO()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getGameName​(FileType filetype)
      Tries to determine the game name from a report.
      • Methods inherited from class java.lang.Object

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

      • eresseaPattern

        protected static java.util.regex.Pattern eresseaPattern
      • atlantisPattern

        protected static java.util.regex.Pattern atlantisPattern
    • Constructor Detail

      • NRGameNameIO

        public NRGameNameIO()
    • Method Detail

      • getGameName

        public java.lang.String getGameName​(FileType filetype)
                                     throws java.io.IOException
        Tries to determine the game name from a report. It tries to get it from the "Spiel" tag and returns "Eressea" if no such tag is found.
        Specified by:
        getGameName in interface GameNameIO
        Parameters:
        filetype -
        Returns:
        A String representing the name of the game or null if the game was not recognized
        Throws:
        java.io.IOException - If an I/O error occurs