|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectir.webutils.Link
public class Link
Link is a class that contains a URL. Subclasses of link may keep additional information (such as anchor text & other attributes)
| Constructor Summary | |
|---|---|
protected |
Link()
May be subclassed. |
|
Link(java.lang.String urlName)
Construct a link with specified URL string |
|
Link(java.net.URL url)
Constructs a link with specified URL. |
| Method Summary | |
|---|---|
static java.net.URL |
cleanURL(java.net.URL url)
Standardize URL by removing trailing slashes, URL decoding it, replacing the UTCS-specific "/users/user" to "/~user" link, and removing a set of common index pages. |
int |
compareTo(Link o)
Compares this Link to another for sorting from best to worst. |
boolean |
equals(java.lang.Object o)
|
double |
getScore()
|
java.net.URL |
getURL()
Returns the URL of this link. |
int |
hashCode()
|
static void |
main(java.lang.String[] args)
|
static java.net.URL |
removeEndSlash(java.net.URL url)
Removes slash at end of URL to normalize |
static java.net.URL |
removeRef(java.net.URL url)
Remove the internal "ref" pointer in a URL if there is one. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected Link()
Link.
public Link(java.net.URL url)
url - The URL for this link.public Link(java.lang.String urlName)
| Method Detail |
|---|
public final java.net.URL getURL()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic static java.net.URL cleanURL(java.net.URL url)
url - The unnormalized URL
public static java.net.URL removeEndSlash(java.net.URL url)
public static java.net.URL removeRef(java.net.URL url)
public static void main(java.lang.String[] args)
public double getScore()
public int compareTo(Link o)
compareTo in interface java.lang.Comparable<Link>o - The Link to compare with.
Collections.sort
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||