20 package net.sf.gridarta.model.mapmodel;
23 import java.io.Serializable;
24 import org.jetbrains.annotations.NotNull;
25 import org.jetbrains.annotations.Nullable;
31 public class MapFile implements Serializable {
54 public MapFile(@NotNull
final File mapsDir) {
65 mapsDir = parent.mapsDir;
75 mapsDir = parent.mapsDir;
103 return new File(mapsDir, mapPath.
getPath());
115 if (!mapsDir.equals(mapFile.mapsDir)) {
122 public boolean equals(@Nullable
final Object obj) {
123 if (obj == null || getClass() != obj.getClass()) {
132 return mapsDir.hashCode() + mapPath.
hashCode();
String getPath()
Returns the map path information.
A MapPath that is absolute, that is, it starts with a "/".
AbsoluteMapPath getMapPath()
Returns the map path within getMapsDir().
Represents a maps directory local map path.
RelativeMapPath getRelativeMapPathTo(@NotNull final MapPath mapPath)
Returns a map path of an another map path relative to this map path.
final File mapsDir
The maps directory this map file is part of.
boolean equals(@Nullable final Object obj)
MapFile(@NotNull final MapFile parent, @NotNull final MapPath mapPath)
Creates a new instance.
boolean equals(@Nullable final Object obj)
Utility class for MapPath related functions.
MapPath getRelativeMapFileTo(@NotNull final MapFile mapFile)
Returns a map path of an another map file relative to this map file.
static final long serialVersionUID
The serial version UID.
MapFile(@NotNull final File mapsDir)
Creates a new instance for the maps directory.
File getMapsDir()
Returns the base directory this map file is part of.
Thrown if two map files are within different map directories.
final AbsoluteMapPath mapPath
The absolute map path within mapsDir.
static AbsoluteMapPath append(@NotNull final AbsoluteMapPath baseMapPath, @NotNull final MapPath mapPath)
Appends a map path to another map path.
File getFile()
Returns a File for this map file.
MapFile(@NotNull final MapFile parent, @NotNull final String name)
Creates a new instance for a child of a parent map file.
The location of a map file with a map directory.