001/*
002 *                    BioJava development code
003 *
004 * This code may be freely distributed and modified under the
005 * terms of the GNU Lesser General Public Licence.  This should
006 * be distributed with the code.  If you do not have a copy,
007 * see:
008 *
009 *      http://www.gnu.org/copyleft/lesser.html
010 *
011 * Copyright for this code is held jointly by the individual
012 * authors.  These should be listed in @author doc comments.
013 *
014 * For more information on the BioJava project and its aims,
015 * or to join the biojava-l mailing list, visit the home page
016 * at:
017 *
018 *      http://www.biojava.org/
019 *
020 */
021
022package org.biojava.nbio.structure;
023
024import java.io.Serializable;
025
026/**
027 * Describes author attributes for author information in a PDB file.
028 * @author Jules Jacobsen
029 */
030public class Author implements Serializable{
031
032        private static final long serialVersionUID = 4840370515056666418L;
033        private String surname = "";
034        private String initials = "";
035
036
037        public String getInitials() {
038                return initials;
039        }
040
041        public void setInitials(String initials) {
042                this.initials = initials;
043        }
044
045        public String getSurname() {
046                return surname;
047        }
048
049        public void setSurname(String surname) {
050                this.surname = surname;
051        }
052
053        @Override
054        public boolean equals(Object obj) {
055                if (obj == null) {
056                        return false;
057                }
058                if (getClass() != obj.getClass()) {
059                        return false;
060                }
061                final Author other = (Author) obj;
062                if ((this.surname == null) ? (other.surname != null) : !this.surname.equals(other.surname)) {
063                        return false;
064                }
065                return !((this.initials == null) ? (other.initials != null) : !this.initials.equals(other.initials));
066        }
067
068        @Override
069        public int hashCode() {
070                int hash = 3;
071                hash = 19 * hash + (this.surname != null ? this.surname.hashCode() : 0);
072                hash = 19 * hash + (this.initials != null ? this.initials.hashCode() : 0);
073                return hash;
074        }
075
076        @Override
077        public String toString() {
078                return initials + surname;
079        }
080
081
082
083}