cds.simbad
Class Reference

java.lang.Object
  extended bycds.simbad.Reference
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable, java.io.Serializable, SimbadObject

public class Reference
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable, java.lang.Comparable, SimbadObject

See Also:
Serialized Form

Field Summary
private  java.util.ArrayList authors
           
private  Bibcode bibcode
           
static java.lang.String COM_ABBR
           
static int COM_DIC
           
static int COM_ERR
           
static int COM_FILES
           
static int COM_FLAGS
           
static int COM_MAX
           
static java.lang.String[] COM_NAME
           
static int COM_NOTES
           
private  java.lang.String journal
           
private  int lastPage
           
private  java.lang.String privateComment
           
private  java.lang.String[] publicComments
           
private  java.lang.String title
           
private  int volume
           
private  java.lang.String year
           
 
Constructor Summary
Reference()
          Empty constructor.
Reference(Bibcode bibcode)
          Constructor initialized with a Bibcode object
Reference(java.lang.String bibcode)
          Constructor initializing a Reference object with a bibcode
Reference(java.lang.String bibcode, boolean normalize)
          Constructor initializing a Reference object with a bibcode
 
Method Summary
 java.lang.Object clone()
          Creates an initialize the Reference from a Parfile file be read from the 1st encountered empty line (separator) to the next one, leaving the file ready for further reads.
 int compareTo(java.lang.Object object)
          MOD-BB 29/10/03 Comparaison de References.
 boolean fromParfile(java.io.BufferedReader rdr)
          Initialize the reference from a Parfile.
 java.util.ArrayList getAuthors()
          Get the author list
 Bibcode getBibcode()
          Gets the bibcode object.
 java.lang.String getJournal()
          Get the journal
 int getLastPage()
          Get last page number
 java.lang.String getPrivateComment()
          Get the private comment
 java.lang.String getPublicComment(int type)
          Get a public comment
 java.lang.String[] getPublicComments()
          Get the array of public comments
 java.lang.String getTitle()
          Get the title
 int getVolume()
          Get the volume
 java.lang.String getYear()
          Get the year
static java.lang.String joinAuthors(java.util.ArrayList alist)
          Build the full string of authors from the arrayList
static java.lang.String joinAuthors(java.util.ArrayList alist, boolean and)
          Build the full string of authors from the arrayList
static java.lang.String joinPublicComments(java.lang.String[] publicComments)
          Join an array of public comments into one string following the syntax described for splitPublicComments
 void reset()
          Reinitialize a Reference object (for reuse purpose)
 void setAuthor(java.lang.String author)
          Sets an author.
 void setAuthors(java.util.ArrayList authors_list)
          MOD-BB 20/10/03 Ajout de cette méthode.
 void setAuthors(java.lang.String[] authorlist)
          Sets an author list.
 void setBibcode(Bibcode bibcode)
          Sets the bibcode
 void setBibcode(java.lang.String bibcode)
          Sets the bibcode
 void setBibcode(java.lang.String bibcode, boolean normalize)
          Sets the bibcode
 void setJournal(java.lang.String journal)
          Set the journal
 void setLastPage(int lastpage)
          Set last page number
 void setLastPage(java.lang.String lastpage)
          Set last page number
 void setPrivateComment(java.lang.String comment)
          Set the private comment
 void setPublicComment(char type, java.lang.String comment)
          Set a public comment.
 void setPublicComment(int type, java.lang.String comment)
          Set a public comment.
 void setPublicComments(java.lang.String[] public_comments)
          MOD-BB 20/10/03 ajout de cette méthode.
 void setTitle(java.lang.String title)
          Set the title
 void setVolume(int volume)
          Set the volume
 void setYear(java.lang.String year)
          Set the year
static java.util.ArrayList splitAuthors(java.lang.String authlist)
          Split a author list in its individual author names
static java.lang.String[] splitPublicComments(java.lang.String publicComments)
          Splits a public comment string having the described syntax in its individual comments array.
 java.lang.String toString()
          Methode d'edition d'une reference
 void toXML(VOTable vot)
          XML output for the astronomical object.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COM_ABBR

public static final java.lang.String COM_ABBR
See Also:
Constant Field Values

COM_NAME

public static final java.lang.String[] COM_NAME

COM_ERR

public static final int COM_ERR
See Also:
Constant Field Values

COM_DIC

public static final int COM_DIC
See Also:
Constant Field Values

COM_FLAGS

public static final int COM_FLAGS
See Also:
Constant Field Values

COM_FILES

public static final int COM_FILES
See Also:
Constant Field Values

COM_NOTES

public static final int COM_NOTES
See Also:
Constant Field Values

COM_MAX

public static final int COM_MAX

bibcode

private Bibcode bibcode

title

private java.lang.String title

journal

private java.lang.String journal

year

private java.lang.String year

volume

private int volume

lastPage

private int lastPage

authors

private java.util.ArrayList authors

publicComments

private java.lang.String[] publicComments

privateComment

private java.lang.String privateComment
Constructor Detail

Reference

public Reference()
Empty constructor. Can be further initialized with set() methods or fromParfile() method


Reference

public Reference(java.lang.String bibcode)
          throws BibcodeException
Constructor initializing a Reference object with a bibcode

Parameters:
bibcode - the bibcode. The string will be forcelly normalized
Throws:
BibcodeException

Reference

public Reference(java.lang.String bibcode,
                 boolean normalize)
          throws BibcodeException
Constructor initializing a Reference object with a bibcode

Parameters:
bibcode - the bibcode. The string will only be normalized if the normalize parameter is set to true.
normalize - true if the bibcode has to be normalized
Throws:
BibcodeException

Reference

public Reference(Bibcode bibcode)
Constructor initialized with a Bibcode object

Parameters:
bibcode - the bibcode object
Method Detail

reset

public void reset()
Reinitialize a Reference object (for reuse purpose)


setBibcode

public void setBibcode(java.lang.String bibcode)
                throws BibcodeException
Sets the bibcode

Parameters:
bibcode - string representing a bibcode.It doesn't need to be normalized
Throws:
BibcodeException

setBibcode

public void setBibcode(java.lang.String bibcode,
                       boolean normalize)
                throws BibcodeException
Sets the bibcode

Parameters:
bibcode - string representing a bibcode.It doesn't need to be normalized
normalize - true if the bibcode should e normalized
Throws:
BibcodeException

setBibcode

public void setBibcode(Bibcode bibcode)
Sets the bibcode

Parameters:
bibcode - Bibcode object

getBibcode

public Bibcode getBibcode()
Gets the bibcode object.

Returns:
the bibcode object

setTitle

public void setTitle(java.lang.String title)
Set the title

Parameters:
title - title text

getTitle

public java.lang.String getTitle()
Get the title

Returns:
the title

setJournal

public void setJournal(java.lang.String journal)
Set the journal

Parameters:
journal - journal name

getJournal

public java.lang.String getJournal()
Get the journal

Returns:
the journal name

setYear

public void setYear(java.lang.String year)
Set the year

Parameters:
year - year to set

getYear

public java.lang.String getYear()
Get the year

Returns:
the year

setVolume

public void setVolume(int volume)
Set the volume

Parameters:
volume - publication volume

getVolume

public int getVolume()
Get the volume

Returns:
the publication volume

setLastPage

public void setLastPage(java.lang.String lastpage)
Set last page number

Parameters:
lastpage - last page number

setLastPage

public void setLastPage(int lastpage)
Set last page number

Parameters:
lastpage - last page number

getLastPage

public int getLastPage()
Get last page number

Returns:
last page number

setAuthor

public void setAuthor(java.lang.String author)
Sets an author. The name is added to the author list at the current position

Parameters:
author - author name

setAuthors

public void setAuthors(java.lang.String[] authorlist)
Sets an author list. The list is added to the full author list from the current position on.

Parameters:
authorlist - list (possibly partial) author list

setAuthors

public void setAuthors(java.util.ArrayList authors_list)
MOD-BB 20/10/03 Ajout de cette méthode.

Parameters:
authors_list - Un list d'auteurs.

getAuthors

public java.util.ArrayList getAuthors()
Get the author list

Returns:
the author list

setPublicComment

public void setPublicComment(int type,
                             java.lang.String comment)
Set a public comment. Several public comments exist:

Parameters:
type - comment type. it can be either the code (preferably using Reference.COM_ERR, Reference.COM_DIC, etc...) or the letter ('E','C',...)
comment - comment text

setPublicComment

public void setPublicComment(char type,
                             java.lang.String comment)
Set a public comment.

Parameters:
type - letter definition ('E','C', ...)
comment - comment text

getPublicComment

public java.lang.String getPublicComment(int type)
Get a public comment

Parameters:
type - comment type (can be either its code (i.e. Reference.COM_FILES), or the letter (i.e. 'c')
Returns:
the requested comment or null

getPublicComments

public java.lang.String[] getPublicComments()
Get the array of public comments

Returns:
the array of strings containing the public comments. See setPublicComment(int, String) for the index value of each comment

setPublicComments

public void setPublicComments(java.lang.String[] public_comments)
MOD-BB 20/10/03 ajout de cette méthode.

Parameters:
public_comments - Commentaires public.

setPrivateComment

public void setPrivateComment(java.lang.String comment)
Set the private comment

Parameters:
comment - private comment

getPrivateComment

public java.lang.String getPrivateComment()
Get the private comment

Returns:
private comment

fromParfile

public boolean fromParfile(java.io.BufferedReader rdr)
Initialize the reference from a Parfile.

Parameters:
rdr - input file
Returns:
true as long as a reference could be built. false afterwards

splitPublicComments

public static java.lang.String[] splitPublicComments(java.lang.String publicComments)
Splits a public comment string having the described syntax in its individual comments array. The syntax is:
(t) comment of type t|(u) comment of type u|...

Parameters:
publicComments - string containing all public comments
Returns:
the string array of individual comments

joinPublicComments

public static java.lang.String joinPublicComments(java.lang.String[] publicComments)
Join an array of public comments into one string following the syntax described for splitPublicComments

Parameters:
publicComments - the array of public comments
Returns:
the string grouping all public comments

splitAuthors

public static java.util.ArrayList splitAuthors(java.lang.String authlist)
Split a author list in its individual author names

Parameters:
authlist - list of authors. The names must be separated by a comma. The two last authors may be separated by ' and '.
Returns:
an ArrayList of authors

joinAuthors

public static java.lang.String joinAuthors(java.util.ArrayList alist)
Build the full string of authors from the arrayList

Parameters:
alist - ArrayList of author names
Returns:
the string of authors, separated by commas

joinAuthors

public static java.lang.String joinAuthors(java.util.ArrayList alist,
                                           boolean and)
Build the full string of authors from the arrayList

Parameters:
alist - ArrayList of author names
and - true if the 'and' operator should be applied between the two las authors of the list
Returns:
the string of authors, separated by commas, except the two last ones which may be separated by ' and '

clone

public java.lang.Object clone()
Creates an initialize the Reference from a Parfile file be read from the 1st encountered empty line (separator) to the next one, leaving the file ready for further reads.

Returns:
the cloned object

toXML

public void toXML(VOTable vot)
XML output for the astronomical object. The XML output is managed by the VOTable object. This astronomical object will be added in the VOTable output as a new RESOURCE. Any number of astronomical objects can be appended to a VOTable object.

Specified by:
toXML in interface SimbadObject
Parameters:
vot - VOTable object driving the output.

toString

public java.lang.String toString()
Methode d'edition d'une reference

Specified by:
toString in interface SimbadObject
Returns:
chaine contenant la reference editee

compareTo

public int compareTo(java.lang.Object object)
MOD-BB 29/10/03 Comparaison de References.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
object - Référence que l'on veut comparer.
Returns:
-1 si le bibcode est < que celui du paramètre, +1 si le bibcode est >, 0 sinon.