Reference Class Reference

One way of referencing a published paper, for example the hep-ex number, the journal reference, the institute's preprint code, etc. More...

Inheritance diagram for Reference:

Inheritance graph
[legend]

Collaboration diagram for Reference:

Collaboration graph
[legend]

List of all members.


Public Member Functions

 Reference ()
 No-arg constructor.
 Reference (String description)
 Constructor from a short description.
 Reference (RefType type, String description)
 Constructor from a RefType and a description.
 Reference (RefType type, String description, Date date)
 Constructor from a RefType, a description and a date.
Date getDate ()
 Get the date of this Reference.
Reference setDate (Date date)
 Set the date of this Reference.
RefType getType ()
 Get type of reference (as RefType enum).
Reference setType (RefType type)
 Set type of reference (as RefType enum).
String getDescription ()
 Get description.
Reference setDescription (String description)
 Set description.
String getComment ()
 Get comment.
Reference setComment (String comment)
 Set comment.
int compareTo (Reference other)
String toString ()
 String representation.
boolean equals (Object other)
int hashCode ()

Package Functions

Logger log ()
 Neat method to allow every class to get hold of a custom-named Logger.

Detailed Description

One way of referencing a published paper, for example the hep-ex number, the journal reference, the institute's preprint code, etc.

Author:
Andy Buckley
Version:
Date
2007-09-25 15:44:34 +0100 (Tue, 25 Sep 2007)
Revision
1077

Definition at line 15 of file Reference.java.


Constructor & Destructor Documentation

Reference (  ) 

No-arg constructor.

Definition at line 39 of file Reference.java.

00039 { super(); }

Reference ( String  description  ) 

Constructor from a short description.

Definition at line 42 of file Reference.java.

References Reference.setDescription().

00042                                          {
00043         this();
00044         setDescription(description);
00045     }

Reference ( RefType  type,
String  description 
)

Constructor from a RefType and a description.

Definition at line 48 of file Reference.java.

References Reference.setType().

00048                                                        {
00049         this(description);
00050         setType(type);
00051     }

Reference ( RefType  type,
String  description,
Date  date 
)

Constructor from a RefType, a description and a date.

Definition at line 54 of file Reference.java.

References Reference.setDate().

00054                                                                   {
00055         this(type, description);
00056         setDate(date);
00057     }


Member Function Documentation

Date getDate (  ) 

Get the date of this Reference.

Definition at line 64 of file Reference.java.

Referenced by Reference.compareTo(), and Reference.hashCode().

00064                           {
00065         return _date;
00066     }

Reference setDate ( Date  date  ) 

Set the date of this Reference.

Definition at line 68 of file Reference.java.

Referenced by Reference.Reference().

00068                                         {
00069         _date = date;
00070         return this;
00071     }

RefType getType (  ) 

Get type of reference (as RefType enum).

Definition at line 75 of file Reference.java.

Referenced by Reference.hashCode(), and Reference.toString().

00075                              {
00076         return _type;
00077     }

Reference setType ( RefType  type  ) 

Set type of reference (as RefType enum).

Definition at line 79 of file Reference.java.

Referenced by Reference.Reference().

00079                                            {
00080         _type = type;
00081         return this;
00082     }

String getDescription (  ) 

Get description.

Definition at line 86 of file Reference.java.

Referenced by Reference.hashCode().

00086                                    {
00087         return _description;
00088     }

Reference setDescription ( String  description  ) 

Set description.

Definition at line 90 of file Reference.java.

Referenced by Reference.Reference().

00090                                                         {
00091         _description = description;
00092         return this;
00093     }

String getComment (  ) 

Get comment.

Definition at line 97 of file Reference.java.

Referenced by Reference.hashCode().

00097                                {
00098         return _comment;
00099     }

Reference setComment ( String  comment  ) 

Set comment.

Definition at line 101 of file Reference.java.

00101                                                 {
00102         _comment = comment;
00103         return this;
00104     }

int compareTo ( Reference  other  ) 

Definition at line 110 of file Reference.java.

References Reference.getDate(), and Storeable.log().

00110                                           {
00111         log().debug("Comparing references...");
00112         return getDate().compareTo(other.getDate());
00113     }

String toString (  ) 

String representation.

Reimplemented from Storeable.

Definition at line 120 of file Reference.java.

References Reference.getType().

00120                              {
00121         StringBuffer s = new StringBuffer();
00122         s.append("Reference: " + getType().toString() + " " );
00123         return s.toString();
00124     }

boolean equals ( Object  other  ) 

Definition at line 126 of file Reference.java.

References Reference.hashCode().

00126                                         {
00127         if (this == other) return true;
00128         if (!(other instanceof Reference)) return false;
00129         return (hashCode() == other.hashCode());
00130     }

int hashCode (  ) 

Definition at line 132 of file Reference.java.

References Reference.getComment(), Reference.getDate(), Reference.getDescription(), and Reference.getType().

Referenced by Reference.equals().

00132                           {
00133          int result = 17;
00134          result ^= getDate().hashCode();
00135          result ^= getType().hashCode();
00136          result ^= getDescription().hashCode();
00137          result ^= getComment().hashCode();
00138          return result;
00139      }

Logger log (  )  [package, inherited]


The documentation for this class was generated from the following file:


Generated on Tue Apr 21 15:54:49 2009 for HepData object model by  doxygen 1.5.5