| 1 | /* |
| 2 | * ContourAttrib.java |
| 3 | * |
| 4 | * Copyright (c) 2002-2015 Alexei Drummond, Andrew Rambaut and Marc Suchard |
| 5 | * |
| 6 | * This file is part of BEAST. |
| 7 | * See the NOTICE file distributed with this work for additional |
| 8 | * information regarding copyright ownership and licensing. |
| 9 | * |
| 10 | * BEAST is free software; you can redistribute it and/or modify |
| 11 | * it under the terms of the GNU Lesser General Public License as |
| 12 | * published by the Free Software Foundation; either version 2 |
| 13 | * of the License, or (at your option) any later version. |
| 14 | * |
| 15 | * BEAST is distributed in the hope that it will be useful, |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 | * GNU Lesser General Public License for more details. |
| 19 | * |
| 20 | * You should have received a copy of the GNU Lesser General Public |
| 21 | * License along with BEAST; if not, write to the |
| 22 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, |
| 23 | * Boston, MA 02110-1301 USA |
| 24 | */ |
| 25 | |
| 26 | package dr.geo.contouring; |
| 27 | |
| 28 | |
| 29 | /** |
| 30 | * <p> This object represents the attributes assigned to a |
| 31 | * contour path. Typically, the same attributes are |
| 32 | * assigned to all the contour paths of a given contour |
| 33 | * level. |
| 34 | * </p> |
| 35 | * |
| 36 | * <p> Right now, the only attribute used is "level", but |
| 37 | * in the future I may add more. |
| 38 | * </p> |
| 39 | * |
| 40 | * <p> Modified by: Joseph A. Huwaldt </p> |
| 41 | * |
| 42 | * @author Joseph A. Huwaldt Date: November 11, 2000 |
| 43 | * @version November 17, 2000 |
| 44 | * |
| 45 | * |
| 46 | * @author Marc Suchard |
| 47 | **/ |
| 48 | public class ContourAttrib implements Cloneable, java.io.Serializable { |
| 49 | |
| 50 | // The level (altitude) of a contour path. |
| 51 | private double level; |
| 52 | |
| 53 | |
| 54 | /** |
| 55 | * Create a contour attribute object where only |
| 56 | * the contour level is specified. |
| 57 | **/ |
| 58 | public ContourAttrib(double level) { |
| 59 | this.level = level; |
| 60 | } |
| 61 | |
| 62 | /** |
| 63 | * Return the level stored in this contour attribute. |
| 64 | **/ |
| 65 | public double getLevel() { |
| 66 | return level; |
| 67 | } |
| 68 | |
| 69 | /** |
| 70 | * Set or change the level stored in this contour attribute. |
| 71 | **/ |
| 72 | public void setLevel(double level) { |
| 73 | this.level = level; |
| 74 | } |
| 75 | |
| 76 | /** |
| 77 | * Make a copy of this ContourAttrib object. |
| 78 | * |
| 79 | * @return Returns a clone of this object. |
| 80 | **/ |
| 81 | public Object clone() { |
| 82 | ContourAttrib newObject = null; |
| 83 | |
| 84 | try { |
| 85 | // Make a shallow copy of this object. |
| 86 | newObject = (ContourAttrib) super.clone(); |
| 87 | |
| 88 | // There is no "deep" data to be cloned. |
| 89 | |
| 90 | } catch (CloneNotSupportedException e) { |
| 91 | // Can't happen. |
| 92 | e.printStackTrace(); |
| 93 | } |
| 94 | |
| 95 | // Output the newly cloned object. |
| 96 | return newObject; |
| 97 | } |
| 98 | |
| 99 | } |
| 100 |