Package Torello.JavaDoc
Class RelativePathStr
- java.lang.Object
-
- Torello.JavaDoc.RelativePathStr
-
public class RelativePathStr extends java.lang.Object
Keeps a copy of theStringas 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-Stringto 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 longserialVersionUIDRelative-Path from a Java-Doc Sub-Directory to the Root JD-Directory - uses '/'as Path-SeparatorModifier and Type Field StringurlsRelative-Path from a Java-Doc Sub-Directory to the Root JD-Directory - uses File.separatorModifier and Type Field StringfileSystem
-
Constructor Summary
Constructors Constructor 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.
ThisStringuses the forward-slash'/', which is the Directory Separator used by Web-Browsers inURL's.- Code:
- Exact Field Declaration Expression:
public final String urls;
-
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 thisStringuses the File-System'sFile.separatorbetween 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 whichStringto use is best left as a choice to be made by the developer.- Code:
- Exact Field Declaration Expression:
public final String fileSystem;
-
-
Constructor Detail
-
RelativePathStr
public RelativePathStr(java.lang.String fileSystem)
-
-
Method Detail
-
toString
public java.lang.String toString()
Retrieve aStringrepresentation of'this'instance's data.- Overrides:
toStringin 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:
hashCodein 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:
equalsin classjava.lang.Object- Returns:
TRUEif'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);
-
-