Package Torello.JavaDoc
Class RelativePathStr
- java.lang.Object
-
- Torello.JavaDoc.RelativePathStr
-
public class RelativePathStr extends java.lang.Object
Keeps a copy of theString
as a series of'../'
(Dot-Dot's) the connects a Sub-Directory to some Root Parent-Directory.
This class is vital to a (albeit a very small) sub-set of the operations of the Upgrade Process. When adding links to'.html'
,'.js'
or even Image Files in the Root JavaDoc Directory, a quick way to obtain the necessary Path-String
to the Root Directory can be extremely convenient.
An instance of this class is always available from the main classJavaDocHTMLFile
, using the public constant fieldJavaDocHTMLFile.dotDots
.
ExampleString's
Some example of the values maintained by this class would include:Relative Path String Java-Doc HTML File "../../"
javadoc/Torello/HTML/package-summary.html
"../../"
javadoc/Torello/Java/package-summary.html
"../../../../"
javadoc/Torello/HTML/Tools/Images/ImageScraper.html
Hi-Lited Source-Code:- View Here: Torello/JavaDoc/RelativePathStr.java
- Open New Browser-Tab: Torello/JavaDoc/RelativePathStr.java
File Size: 4,718 Bytes Line Count: 121 '\n' Characters Found
-
-
Field Summary
Serializable ID Modifier and Type Field protected static long
serialVersionUID
Relative-Path from a Java-Doc Sub-Directory to the Root JD-Directory - uses '/'
as Path-SeparatorModifier and Type Field String
urls
Relative-Path from a Java-Doc Sub-Directory to the Root JD-Directory - uses File.separator
Modifier and Type Field String
fileSystem
-
Constructor Summary
Constructors Constructor Description RelativePathStr(String fileSystem)
-
-
-
Field Detail
-
serialVersionUID
protected static final long serialVersionUID
- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
protected static final long serialVersionUID = 1;
-
urls
public final java.lang.String urls
Dot-Dot'../../'
, Relative-Path-String from the a Java-Doc Sub-Directory / Package-Directory to the Root JavaDoc-Directory.
ThisString
uses the forward-slash'/'
, which is the Directory Separator used by Web-Browsers inURL's
.
-
fileSystem
public final java.lang.String fileSystem
Dot-Dot'../../'
, Relative-Path-String from the a Java-Doc Sub-Directory / Package-Directory to the Root JavaDoc-Directory.
This is the exact same Relative-Path-String asurls
, but thisString
uses the File-System'sFile.separator
between separate Directory-Names.
This separator may be either a'/'
Foward-Slash, or a'\
Backward-Slash. It is dependent on which Operating-System the Java Virtual Machine is currently running.
MS-DOS Note:
Most know that the'/'
Foward-Slash is always used in UNIX, and by Web-BrowsersURL's
. Years ago, however, an MS-DOS / Windows Computer running Java would stick by its choice to use the'\'
as a Path-Separator.
In later releases of DOS / Windows, Microsoft actuallh decided to allow either the forward or backward slash as a Path-Separator. This decision, sort of, makes this class a little superfluous and out-dated. However, it was decided that choosing whichString
to use is best left as a choice to be made by the developer.
-
-
Constructor Detail
-
RelativePathStr
public RelativePathStr(java.lang.String fileSystem)
-
-
Method Detail
-
toString
public java.lang.String toString()
Retrieve aString
representation of'this'
instance's data.- Overrides:
toString
in classjava.lang.Object
- Returns:
- The contents of this class, converted to a
String
- Code:
- Exact Method Body:
return "File-System Relative-Path to Root: " + fileSystem + '\n' + "Browsser-URL Relative-Path to Root: " + urls + '\n';
-
hashCode
public int hashCode()
Generates a Hash-Table's Hash-Code for'this'
instance's data.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- An integer that may be used for hashing
'this'
instance. - Code:
- Exact Method Body:
return fileSystem.hashCode();
-
equals
public boolean equals(java.lang.Object other)
Checks whether'this'
equals'other'
- Overrides:
equals
in classjava.lang.Object
- Returns:
TRUE
if'this'
equals'other'
- Code:
- Exact Method Body:
if (! RelativePathStr.class.isAssignableFrom(other.getClass())) return false; RelativePathStr o = (RelativePathStr) other; return this.fileSystem.equals(o.fileSystem) && this.urls.equals(o.urls);
-
-