Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/openscience/compchem/Element.java


1   /* Element.java
2    *
3    * Copyright (C) 1997, 1998  Dr. Christoph Steinbeck 
4    * 
5    * Contact: steinbeck@ice.mpg.de
6    * 
7    * This program is free software; you can redistribute it and/or
8    * modify it under the terms of the GNU General Public License as
9    * published by the Free Software Foundation; either version 2 of the
10   * License, or (at your option) any later version.  All I ask is that
11   * proper credit is given for my work, which includes - but is not
12   * limited to - adding the above copyright notice to the beginning of
13   * your source code files, and to any copyright notice that you may
14   * distribute with programs based on this work.
15   * 
16   * This program is distributed in the hope that it will be useful, but
17   * WITHOUT ANY WARRANTY; without even the implied warranty of
18   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19   * General Public License for more details.
20   * 
21   * You should have received a copy of the GNU General Public License
22   * along with this program; if not, write to the Free Software
23   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
24   * 02111-1307, USA.
25   *  
26   */
27  
28  package org.openscience.compchem;
29  
30  
31  /** Elemement.java
32   * Used to store data of a particular Element
33   */
34  
35  public class Element extends Object implements Cloneable {
36  
37      public String symbol= "";
38      public int maxBondOrder = -1;
39      public int maxBondOrderSum = -1;
40  
41      public Element(String symbol, int maxBondOrder, int maxBondOrderSum) {
42          this.symbol = symbol;
43          this.maxBondOrder = maxBondOrder;
44          this.maxBondOrderSum = maxBondOrderSum;
45      }
46  
47      public Object clone() {
48          Element e = new Element(symbol, maxBondOrder, maxBondOrderSum);
49          e.symbol = this.symbol;
50          e.maxBondOrder = this.maxBondOrder;
51          e.maxBondOrderSum = this.maxBondOrderSum;
52          return e;
53      }
54  
55      public String toString() {
56          String s = symbol + ": maximum bond order = " + maxBondOrder;
57          s += "; maximum sum of bond orders = " + maxBondOrderSum;
58          return s;
59      }
60  }