NetKernel APIs


com.ten60.netkernel.urii
Class URIdentifier

java.lang.Object
  extended bycom.ten60.netkernel.urii.URIdentifier

public final class URIdentifier
extends Object

A Universal Resource Identifier. This implementation is a simple wrapper over a string that minimises processing and storage costs if all you want to do is pass a URI around and use it as a string.


Constructor Summary
URIdentifier(String aString)
          Creates a new instance of URIdentifier
 
Method Summary
 boolean equals(Object aOther)
           
static URIdentifier fromEscaped(String aURI)
           
 String getFragment()
          return the last fragment in this URI, null if not found
 String getScheme()
           
 String getSchemeSpecificPart()
          return the scheme specific part of this URI, I.e.
static URIdentifier getUnique(String aPrefix)
           
 int hashCode()
           
 String toString()
           
 URIdentifier withFragment(String aFragment)
          return this URI without the fragment set as specified
 URIdentifier withoutFragment()
          return this URI without the last fragment
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

URIdentifier

public URIdentifier(String aString)
Creates a new instance of URIdentifier

Method Detail

toString

public String toString()
Returns:
a string representation of a URI

equals

public boolean equals(Object aOther)
Returns:
true if two URIs are equal

hashCode

public int hashCode()
Returns:
a hashcode for the URI

getUnique

public static URIdentifier getUnique(String aPrefix)
Returns:
a unique URI with the given prefix and ending in a unique number

fromEscaped

public static URIdentifier fromEscaped(String aURI)
Returns:
a URI built from an escaped (with %) string

getScheme

public String getScheme()

getFragment

public String getFragment()
return the last fragment in this URI, null if not found


withoutFragment

public URIdentifier withoutFragment()
return this URI without the last fragment


withFragment

public URIdentifier withFragment(String aFragment)
return this URI without the fragment set as specified


getSchemeSpecificPart

public String getSchemeSpecificPart()
return the scheme specific part of this URI, I.e. what is between the first scheme and the last fragment


NetKernel APIs


Copyright © 2002-2004 1060 Research Ltd. All Rights Reserved.