Class SRGMapper

    • Constructor Summary

      Constructors 
      Constructor Description
      SRGMapper()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected Mapper buildMapper​(java.util.List<java.lang.String> lines, boolean ignoreErrors, boolean inverted)
      Builds the two mappers, and returns one of the two depending on the flag.
      boolean claim​(java.util.List<java.lang.String> lines)
      Checks whether this mapper can process the given lines.
      Mapper getInvertedMapper​(java.util.List<java.lang.String> lines, boolean ignoreErrors)
      Creates a Mapper given the lines, ignoring errors depending on the given flag, and returns its inverted form.
      Mapper getMapper​(java.util.List<java.lang.String> lines, boolean ignoreErrors)
      Creates a Mapper given the lines, ignoring errors depending on the given flag.
      • Methods inherited from class java.lang.Object

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

      • SRGMapper

        public SRGMapper()
    • Method Detail

      • claim

        public boolean claim​(java.util.List<java.lang.String> lines)
        Description copied from interface: IMappingFormat
        Checks whether this mapper can process the given lines.
        Specified by:
        claim in interface IMappingFormat
        Parameters:
        lines - the lines to read
        Returns:
        whether this type of mapper can process these lines
      • buildMapper

        protected Mapper buildMapper​(java.util.List<java.lang.String> lines,
                                     boolean ignoreErrors,
                                     boolean inverted)
                              throws MalformedMappingsException
        Builds the two mappers, and returns one of the two depending on the flag. Since the SRG format contains descriptor mappings, it's possible to process this right away.
        Parameters:
        lines - the lines to read
        ignoreErrors - try to ignore errors and keep going
        inverted - whether it should return the inverted one
        Returns:
        the Mapper, inverted depending on the flag
        Throws:
        MalformedMappingsException - if an error is encountered and ignoreErrors is false
      • getInvertedMapper

        public Mapper getInvertedMapper​(java.util.List<java.lang.String> lines,
                                        boolean ignoreErrors)
        Description copied from interface: IMappingFormat
        Creates a Mapper given the lines, ignoring errors depending on the given flag, and returns its inverted form.
        Specified by:
        getInvertedMapper in interface IMappingFormat
        Parameters:
        lines - the lines to read
        ignoreErrors - try to ignore errors and keep going
        Returns:
        the inverted Mapper