|
TopoWeb Commons API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.topoweb.net.Ori
Encapsulates a string representation of URIs that is lexicographically
ordered by ownership. This class is an attempt to create a format for
representing global resources in such a way that given a sorted list of their
representations we can quickly find all resources in the list owned by some
parent entity. Translations from some standard URIs to instances of this
class and viceversa are defined in the OriTranslator
class. This class is just a thin wrapper that asserts the structure for
our ORI. An ORI is always of the form
This class is not final, but its methods are. Comparison methods are delegated to the instance's string representation. With respect to the state exposed by these methods, instances of this class are both immutable and final.
PENDING: Give more precise definition of valid characters, and sequences of, in the various parts of the identifier.
Constructor Summary | |
Ori(java.lang.String id)
Creates a new instance using the given identifier. |
Method Summary | |
java.lang.StringBuffer |
appendDomain(java.lang.StringBuffer work)
Appends the domain into the specified work buffer. |
java.lang.StringBuffer |
appendPath(java.lang.StringBuffer work)
Appends the path to the given work buffer. |
java.lang.StringBuffer |
appendScheme(java.lang.StringBuffer work)
Appends the scheme into the specified work buffer. |
java.lang.StringBuffer |
appendUserInfo(java.lang.StringBuffer work)
Appends the user information, if any, to the given work buffer. |
int |
compareTo(java.lang.Object other)
Compares this instance with the other , as per the
java.lang.Comparable contract. |
int |
compareTo(Ori other)
Compares this instance with the other Ori instance. |
boolean |
equals(java.lang.Object other)
Is this instance equal to the other object? |
boolean |
equals(Ori other)
Is this instance equal to the Ori instance? |
java.lang.String |
getDomain()
Returns the domain of this instance. |
java.lang.String |
getPath()
Returns the path portion of this instance. |
int |
getPort()
Returns the port. |
java.lang.String |
getScheme()
Returns the scheme of this instance. |
java.lang.String |
getUserInfo()
Returns the user information portion of this instance. |
int |
hashCode()
Returns the hashcode for this instance as per the contract in java.lang.Object . |
boolean |
hasUserInfo()
Does this instance have a user information? |
java.lang.String |
toString()
Returns the identifier passed in at instantiation. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Ori(java.lang.String id) throws OriSyntaxException
OriSyntaxException
is thrown.
id
- the identifier
OriSyntaxException
- if id
is malformedtoString()
Method Detail |
public final java.lang.StringBuffer appendScheme(java.lang.StringBuffer work)
work
- the work buffer
work
buffergetScheme()
public final java.lang.String getScheme()
appendScheme(StringBuffer)
public final java.lang.StringBuffer appendDomain(java.lang.StringBuffer work)
work
- the work buffer
work
buffergetDomain()
public final java.lang.String getDomain()
appendDomain(StringBuffer)
public final int getPort()
public final boolean hasUserInfo()
true
, if there is user info;
false
, o.w.public final java.lang.StringBuffer appendUserInfo(java.lang.StringBuffer work)
work
- the work buffer
work
buffergetUserInfo()
public final java.lang.String getUserInfo()
null
, if
unspecifiedappendUserInfo(StringBuffer)
public final java.lang.StringBuffer appendPath(java.lang.StringBuffer work)
work
- the work buffer
work
buffergetPath()
public final java.lang.String getPath()
appendPath(StringBuffer)
public final java.lang.String toString()
toString
in class java.lang.Object
public final boolean equals(java.lang.Object other)
equals
in class java.lang.Object
other
- the other object
true
, if other
is an
instance of Ori
, and its string
representation is the same; false
, o.w.toString()
,
hashCode()
public final boolean equals(Ori other)
Ori
instance?
equals(Object)
public final int hashCode()
java.lang.Object
.
hashCode
in class java.lang.Object
public final int compareTo(java.lang.Object other)
other
, as per the
java.lang.Comparable
contract. The comparison is
performed on the string representation of this instance.
compareTo
in interface java.lang.Comparable
other
- the instance compared totoString()
public final int compareTo(Ori other)
Ori
instance.
compareTo(Object)
|
TopoWeb Commons API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |