Class MapFile

  • All Implemented Interfaces:
    java.io.Serializable

    public class MapFile
    extends java.lang.Object
    implements java.io.Serializable
    The location of a map file with a map directory.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      MapFile​(@NotNull java.io.File mapsDir)
      Creates a new instance for the maps directory.
      MapFile​(@NotNull MapFile parent, @NotNull java.lang.String name)
      Creates a new instance for a child of a parent map file.
      MapFile​(@NotNull MapFile parent, @NotNull MapPath mapPath)
      Creates a new instance.
    • Constructor Detail

      • MapFile

        public MapFile​(@NotNull
                       @NotNull java.io.File mapsDir)
        Creates a new instance for the maps directory.
        Parameters:
        mapsDir - the maps directory
      • MapFile

        public MapFile​(@NotNull
                       @NotNull MapFile parent,
                       @NotNull
                       @NotNull java.lang.String name)
        Creates a new instance for a child of a parent map file.
        Parameters:
        parent - the parent map file
        name - the name of the child
      • MapFile

        public MapFile​(@NotNull
                       @NotNull MapFile parent,
                       @NotNull
                       @NotNull MapPath mapPath)
        Creates a new instance.
        Parameters:
        parent - the parent map file
        mapPath - the map path
    • Method Detail

      • getMapsDir

        @NotNull
        public @NotNull java.io.File getMapsDir()
        Returns the base directory this map file is part of.
        Returns:
        the base directory
      • getMapPath

        @NotNull
        public @NotNull AbsoluteMapPath getMapPath()
        Returns the map path within getMapsDir().
        Returns:
        the map path; it is an absolute map path
      • getFile

        @NotNull
        public @NotNull java.io.File getFile()
        Returns a File for this map file.
        Returns:
        the file
      • getRelativeMapFileTo

        @NotNull
        public @NotNull MapPath getRelativeMapFileTo​(@NotNull
                                                     @NotNull MapFile mapFile)
                                              throws DifferentMapBaseException
        Returns a map path of an another map file relative to this map file.
        Parameters:
        mapFile - the other map file
        Returns:
        the relative map path from this map file to the other map file
        Throws:
        DifferentMapBaseException - if the two map files do not have the same maps directory
      • equals

        public boolean equals​(@Nullable
                              @Nullable java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object