bbc.rd.tvanytime
Class URI

java.lang.Object
  extended by bbc.rd.tvanytime.URI
All Implemented Interfaces:
java.lang.Cloneable

public class URI
extends java.lang.Object
implements java.lang.Cloneable

URI: Represents a URI Java 1.1 does not contain java.net.URI, so we need to write our own (very simple) for compatability with this java version.

Version:
1.0
Author:
Tim Sargeant, BBC Research & Development, October 2002

Constructor Summary
URI()
          Constructor for objects of type URI
URI(java.lang.String uri)
          Constructor for objects of type URI with required fields.
 
Method Summary
 java.lang.Object clone()
          Clones itself.
 boolean equals(java.lang.Object obj)
          Are these URIs equal?
 java.lang.String getURI()
          Get the URI
 void setURI(java.lang.String uri)
          Set the URI.
 java.lang.String toString()
          Returns string representation of this object.
 java.lang.String toString(int indent)
          Returns string representation of this object.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

URI

public URI()
Constructor for objects of type URI


URI

public URI(java.lang.String uri)
    throws TVAnytimeException
Constructor for objects of type URI with required fields. Tests for validity of "*://" portion of uri, and throws a TVAnytimeException if invalid. Does not currently test any other part of the URI.

Parameters:
uri - string representation of the URI (e.g. "ftp://bbc.co.uk/21837")
Throws:
TVAnytimeException - thrown when URI starts with invalid pattern
Method Detail

getURI

public java.lang.String getURI()
Get the URI

Returns:
the String representation of the URI (e.g. "ftp://bbc.co.uk/21837") or null if uri is undefined

equals

public boolean equals(java.lang.Object obj)
Are these URIs equal?

Overrides:
equals in class java.lang.Object
Parameters:
uri - The possibly null URI to be compared
Returns:
true if URI is equal to this URI; false otherwise

setURI

public void setURI(java.lang.String uri)
            throws TVAnytimeException
Set the URI. Tests it is valid URI format ": and throws a TVAnytimeException if invalid.

Parameters:
uri - the URI as a String
Throws:
TVAnytimeException

toString

public java.lang.String toString()
Returns string representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
string representation of this object.

toString

public java.lang.String toString(int indent)
Returns string representation of this object.

Parameters:
indent - number of tabs to put before the string.
Returns:
string representation of this object.

clone

public java.lang.Object clone()
Clones itself.

Overrides:
clone in class java.lang.Object
Returns:
A copy of itself.