1 /*** DataPointCategory.java - part of the MirkE (say murky) application for colormetric analysis emphesizing 2 kinetics. 3 4 Created by: Scott Menor on 21 July, 2004. 5 Last modified by: Scott Menor on 6 November, 2004 6 7 Copyright (c) 2004 Arizona State University - Cancer Research Institute. All rights reserved. 8 9 MirkE is free software; you can redistribute it and/or modify 10 it under the terms of the GNU General Public License as published by 11 the Free Software Foundation; either version 2 of the License, or 12 (at your option) any later version. 13 14 MirkE is distributed in the hope that it will be useful, 15 but WITHOUT ANY WARRANTY; without even the implied warranty of 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 GNU General Public License for more details. 18 19 You should have received a copy of the GNU General Public License 20 along with MirkE; if not, write to the Free Software 21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US 22 */ 23 24 package edu.asu.cri.MirkE.dataStructures; 25 26 import java.util.*; 27 28 /*** A collection of related <code>DataPoint</code>s 29 30 TODO - would be *very* nice if categories would automatically update themselves when necessary 31 @author Scott Menor 32 */ 33 public class DataPointCategory { 34 /*** default (0-parameter) constructor 35 36 */ 37 public DataPointCategory() {} 38 39 /*** constructor 40 41 @param categoryName 42 @param categoryType 43 */ 44 public DataPointCategory(String categoryName, 45 String categoryType) { 46 this.categoryName = categoryName; 47 this.categoryType = categoryType; 48 49 } 50 51 private long id; 52 53 /*** 54 55 @return id 56 */ 57 public long getId() { 58 return id; 59 } 60 61 /*** 62 @param id 63 */ 64 public void setId(long id) { 65 this.id = id; 66 } 67 68 private String categoryName; 69 70 /*** 71 72 @return categoryName 73 */ 74 public String getCategoryName() { 75 return categoryName; 76 } 77 78 /*** 79 @param categoryName 80 */ 81 public void setCategoryName(String categoryName) { 82 this.categoryName = categoryName; 83 } 84 85 private String categoryType; 86 87 /*** 88 89 @return categoryType 90 */ 91 public String getCategoryType() { 92 return categoryType; 93 } 94 95 /*** 96 @param categoryType 97 */ 98 public void setCategoryType(String categoryType) { 99 this.categoryType = categoryType; 100 } 101 102 private Set categorySet = null; 103 104 /*** 105 106 @return categorySet 107 */ 108 public Set getCategorySet() { 109 if (categorySet == null) { 110 categorySet = new HashSet(); 111 } 112 113 return categorySet; 114 } 115 116 /*** 117 @param categorySet 118 */ 119 public void setCategorySet(Set categorySet) { 120 this.categorySet = categorySet; 121 } 122 123 /*** 124 @param dataPoint 125 */ 126 public void addDataPoint(DataPoint dataPoint) { 127 getCategorySet().add(dataPoint); 128 } 129 130 /*** 131 132 @param dataPoint 133 */ 134 public void removeDataPoint(DataPoint dataPoint) { 135 getCategorySet().remove(dataPoint); 136 } 137 }