uk.ac.ebi.miriam.data
Class URI

java.lang.Object
  extended by uk.ac.ebi.miriam.data.URI
All Implemented Interfaces:
Serializable, Comparable<Object>

public class URI
extends Object
implements Comparable<Object>, Serializable

Contains all the information about a URI (which can be a URN or a URL).

Copyright:
Copyright (C) 2006-2012 BioModels.net (EMBL - European Bioinformatics Institute)
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Version:
20110309
Author:
Camille Laibe
See Also:
Serialized Form

Constructor Summary
URI()
          Default constructor.
URI(String uri)
          Constructor allowing to set a type of URI.
URI(uk.ac.ebi.miriam.data.URI.typeURI type)
          Constructor allowing to set a type of URI.
 
Method Summary
 int compareTo(Object obj)
          Compares to objects and determine whether they are equivalent or not.
 boolean equals(Object obj)
          Indicates whether some other object is "equal to" this one.
 String getType()
          Getter
static uk.ac.ebi.miriam.data.URI.typeURI getTypeURL()
          Getter of the URL type of URI
static uk.ac.ebi.miriam.data.URI.typeURI getTypeURN()
          Getter of the URN type of URI
 String getURI()
          Getter
 void setURI(String uri)
          Setter (also updates the type of URI)
 String toString()
          Overrides the 'toString()' method for the 'Reference' object
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

URI

public URI()
Default constructor.


URI

public URI(String uri)
Constructor allowing to set a type of URI.


URI

public URI(uk.ac.ebi.miriam.data.URI.typeURI type)
Constructor allowing to set a type of URI. Warning: if the uri is updated and not of the given type, its type will be updated too!

Method Detail

compareTo

public int compareTo(Object obj)
Compares to objects and determine whether they are equivalent or not. Mandatory method for the class to be able to implement 'Comparable'

Specified by:
compareTo in interface Comparable<Object>
Parameters:
obj - the reference object with which to compare
Returns:
0 if the two objects are the same, -1 otherwise

equals

public boolean equals(Object obj)
Indicates whether some other object is "equal to" this one.

Overrides:
equals in class Object
Parameters:
obj - the reference object with which to compare
Returns:
true if this object is the same as the obj argument; false otherwise.

toString

public String toString()
Overrides the 'toString()' method for the 'Reference' object

Overrides:
toString in class Object
Returns:
a string which contains all the information about the reference

getURI

public String getURI()
Getter

Returns:
the uri

setURI

public void setURI(String uri)
Setter (also updates the type of URI)

Parameters:
uri - the uri to set

getType

public String getType()
Getter

Returns:
the type of URI

getTypeURN

public static uk.ac.ebi.miriam.data.URI.typeURI getTypeURN()
Getter of the URN type of URI

Returns:
URN type

getTypeURL

public static uk.ac.ebi.miriam.data.URI.typeURI getTypeURL()
Getter of the URL type of URI

Returns:
URL type


BioModels.net, EMBL-EBI - Feb 2012