Package net.sf.gridarta.model.mapmodel
Class MapFile
- java.lang.Object
-
- net.sf.gridarta.model.mapmodel.MapFile
-
- All Implemented Interfaces:
java.io.Serializable
public class MapFile extends java.lang.Object implements java.io.SerializableThe 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(@Nullable java.lang.Object obj)@NotNull java.io.FilegetFile()Returns aFilefor this map file.@NotNull AbsoluteMapPathgetMapPath()Returns the map path withingetMapsDir().@NotNull java.io.FilegetMapsDir()Returns the base directory this map file is part of.@NotNull MapPathgetRelativeMapFileTo(@NotNull MapFile mapFile)Returns a map path of an another map file relative to this map file.inthashCode()java.lang.StringtoString()
-
-
-
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 filename- the name of the child
-
-
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 withingetMapsDir().- Returns:
- the map path; it is an absolute map path
-
getFile
@NotNull public @NotNull java.io.File getFile()
Returns aFilefor 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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-