Object
SimpleCitation
- All Implemented Interfaces:
CharSequence
,Comparable<InternationalString>
,Citation
,InternationalString
A
Citation
containing only a title attribute as an
InternationalString
. All other citation attributes are null
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
-
Field Summary
Modifier and TypeFieldDescriptionstatic final SimpleCitation
The European Petroleum Survey Group authority.static final SimpleCitation
The Open Geospatial Consortium authority.protected final String
The citation title to be returned bygetTitle()
as anInternationalString
. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionchar
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
Returnstrue
if the given object is aSimpleCitation
having a title equals to this title.getTitle()
Name by which the cited resource is known.int
hashCode()
Returns a hash code value for this citation.int
length()
Returns the number of characters in the title.subSequence
(int start, int end) Returns a substring of the title for the given range of index.toString()
Returns the title as an unlocalized string.Returns the title, ignoring the given locale.Methods inherited from interface CharSequence
chars, codePoints, isEmpty
Methods inherited from interface Citation
getAlternateTitles, getCitedResponsibleParties, getCollectiveTitle, getDates, getEdition, getEditionDate, getGraphics, getIdentifiers, getISBN, getISSN, getOnlineResources, getOtherCitationDetails, getPresentationForms, getSeries
-
Field Details
-
OGC
The Open Geospatial Consortium authority.- See Also:
-
EPSG
The European Petroleum Survey Group authority. This authority provides many CRS definitions. -
title
The citation title to be returned bygetTitle()
as anInternationalString
. This is also the value returned by theInternationalString
methods liketoString(Locale)
andtoString()
.- See Also:
-
-
Constructor Details
-
SimpleCitation
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 Details
-
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
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
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:
-
toString
Returns the title, ignoring the given locale. For localization support, another 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
Description copied from interface:Citation
Name by which the cited resource is known. -
compareTo
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
Returnstrue
if the given object is aSimpleCitation
having a title equals to this title. -
hashCode
public int hashCode()Returns a hash code value for this citation. The hash code is computed from the title string given to the constructor.
-