Package org.opengis.example.metadata
Class SimpleCitation
- Object
-
- SimpleCitation
-
- All Implemented Interfaces:
Serializable
,CharSequence
,Comparable<InternationalString>
,Citation
,InternationalString
public class SimpleCitation extends Object implements Citation, InternationalString, Serializable
ACitation
containing only a title attribute as anInternationalString
. All other citation attributes arenull
or empty collections.This class can also be used as an
InternationalString
implementation. Because there is only one attribute - the title - there is no ambiguity about the value represented by the citation or the international string.- Since:
- 3.1
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static SimpleCitation
EPSG
The European Petroleum Survey Group authority.static SimpleCitation
OGC
The Open Geospatial Consortium authority.protected String
title
The citation title to be returned bygetTitle()
as anInternationalString
.
-
Constructor Summary
Constructors Constructor Description SimpleCitation(String title)
Creates a new citation having the given title.
-
Method Summary
Modifier and Type Method Description char
charAt(int index)
Returns the title character at the given indexint
compareTo(InternationalString object)
Compares the title with the string representation of the given object for order.boolean
equals(Object object)
Returnstrue
if the given object is aSimpleCitation
having a title equals to this title.InternationalString
getTitle()
int
hashCode()
Returns a hash code value for this citation.int
length()
Returns the number of characters in the title.String
subSequence(int start, int end)
Returns a substring of the title for the given range of index.String
toString()
Returns the title as an unlocalized string.String
toString(Locale locale)
Returns the title, ignoring the given locale.-
Methods inherited from interface CharSequence
chars, codePoints
-
Methods inherited from interface Citation
getAlternateTitles, getCitedResponsibleParties, getCollectiveTitle, getDates, getEdition, getEditionDate, getGraphics, getIdentifiers, getISBN, getISSN, getOnlineResources, getOtherCitationDetails, getPresentationForms, getSeries
-
-
-
-
Field Detail
-
OGC
public static final SimpleCitation OGC
The Open Geospatial Consortium authority.- See Also:
Factory.getVendor()
-
EPSG
public static final SimpleCitation EPSG
The European Petroleum Survey Group authority. This authority provides many CRS definitions.
-
title
protected final String title
The citation title to be returned bygetTitle()
as anInternationalString
. This is also the value returned by theInternationalString
methods liketoString(Locale)
andtoString()
.- See Also:
getTitle()
,toString()
,toString(Locale)
-
-
Constructor Detail
-
SimpleCitation
public SimpleCitation(String title)
Creates a new citation having the given title. The given string will be returned, directly or indirectly, by thegetTitle()
,toString()
andtoString(Locale)
methods.- Parameters:
title
- the citation title to be returned indirectly bygetTitle()
.
-
-
Method Detail
-
length
public int length()
Returns the number of characters in the title.- Specified by:
length
in interfaceCharSequence
- Returns:
- the number of
char
s in the title.
-
charAt
public char charAt(int index)
Returns the title character at the given index- Specified by:
charAt
in interfaceCharSequence
- Parameters:
index
- the index of thechar
value to be returned.- Returns:
- the specified
char
value.
-
subSequence
public String subSequence(int start, int end)
Returns a substring of the title for the given range of index.- Specified by:
subSequence
in interfaceCharSequence
- Parameters:
start
- the start index, inclusive.end
- the end index, exclusive.- Returns:
- the specified substring of the title.
-
toString
public String toString()
Returns the title as an unlocalized string. This method returns directly the string given to the constructor.- Specified by:
toString
in interfaceCharSequence
- Specified by:
toString
in interfaceInternationalString
- Overrides:
toString
in classObject
- Returns:
- the string given to the constructor.
- See Also:
getTitle()
-
toString
public String toString(Locale locale)
Returns the title, ignoring the given locale. For localization support, an other class (or a subclass of thisSimpleCitation
class) is required.- Specified by:
toString
in interfaceInternationalString
- Parameters:
locale
- ignored by theSimpleCitation
implementation.- Returns:
- the string given to the constructor, localized if supported by the implementation.
- See Also:
getTitle()
-
getTitle
public InternationalString getTitle()
-
compareTo
public int compareTo(InternationalString object)
Compares the title with the string representation of the given object for order.- Specified by:
compareTo
in interfaceComparable<InternationalString>
- Parameters:
object
- the object to be compared.- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
-
equals
public boolean equals(Object object)
Returnstrue
if the given object is aSimpleCitation
having a title equals to this title.
-
-