Package net.sf.gridarta.model.mapmodel
Class RelativeMapPath
- java.lang.Object
-
- net.sf.gridarta.model.mapmodel.RelativeMapPath
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<RelativeMapPath>,MapPath
public class RelativeMapPath extends java.lang.Object implements java.lang.Comparable<RelativeMapPath>, MapPath
Represents a maps directory local map path.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RelativeMapPath()Creates a new instance.RelativeMapPath(@NotNull AbsoluteMapPath sourceMapPath, @NotNull AbsoluteMapPath destinationMapPath)Creates a new instance as the difference between two absolute map paths.RelativeMapPath(@NotNull RelativeMapPath parent, @NotNull java.lang.String name)Creates a new map path based on a parent map path.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(@NotNull RelativeMapPath o)booleanequals(@Nullable java.lang.Object obj)@Nullable java.lang.StringgetMapComponent()Returns the initial path component of a map path.@NotNull java.lang.StringgetPath()Returns the map path information.@NotNull RelativeMapPathgetRelativeMapPathFrom(@NotNull AbsoluteMapPath mapPath)Returns this map path relative to another map path.inthashCode()java.lang.StringtoString()
-
-
-
Constructor Detail
-
RelativeMapPath
public RelativeMapPath()
Creates a new instance.
-
RelativeMapPath
public RelativeMapPath(@NotNull @NotNull RelativeMapPath parent, @NotNull @NotNull java.lang.String name)Creates a new map path based on a parent map path.- Parameters:
parent- the parent map pathname- the name of the child; "." or ".." are allowed
-
RelativeMapPath
public RelativeMapPath(@NotNull @NotNull AbsoluteMapPath sourceMapPath, @NotNull @NotNull AbsoluteMapPath destinationMapPath)Creates a new instance as the difference between two absolute map paths.- Parameters:
sourceMapPath- the source map path to start fromdestinationMapPath- the destination map path to point to
-
-
Method Detail
-
getPath
@NotNull public @NotNull java.lang.String getPath()
Description copied from interface:MapPathReturns the map path information.
-
getMapComponent
@Nullable public @Nullable java.lang.String getMapComponent()
Description copied from interface:MapPathReturns the initial path component of a map path. "/path/to/map" returns "path", "/map" returnsnull. Relative map paths always returnnull.- Specified by:
getMapComponentin interfaceMapPath- Returns:
- the initial path component
-
getRelativeMapPathFrom
@NotNull public @NotNull RelativeMapPath getRelativeMapPathFrom(@NotNull @NotNull AbsoluteMapPath mapPath)
Description copied from interface:MapPathReturns this map path relative to another map path.- Specified by:
getRelativeMapPathFromin interfaceMapPath- Parameters:
mapPath- the other map path- Returns:
- the relative map path from this map path to the other map path
-
compareTo
public int compareTo(@NotNull @NotNull RelativeMapPath o)- Specified by:
compareToin interfacejava.lang.Comparable<RelativeMapPath>
-
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
-
-