1 /* 2 * Copyright 2011-2013 smartics, Kronseder & Reiner GmbH 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package de.smartics.tagcloud; 17 18 /** 19 * Provides information about one tag. 20 * 21 * @author <a href="mailto:robert.reiner@smartics.de">Robert Reiner</a> 22 * @version $Revision:591 $ 23 */ 24 public class Tag 25 { 26 // ********************************* Fields ********************************* 27 28 // --- constants ------------------------------------------------------------ 29 30 // --- members -------------------------------------------------------------- 31 32 /** 33 * The name of the tag. 34 */ 35 private final String name; 36 37 /** 38 * The frequency the tag has been used. 39 */ 40 private final int score; 41 42 /** 43 * The relative frequency. 44 */ 45 private final int weight; 46 47 // ****************************** Initializer ******************************* 48 49 // ****************************** Constructors ****************************** 50 51 /** 52 * Default constructor. 53 * 54 * @param name the name of the tag. 55 * @param score the frequency the tag has been used. 56 * @param weight the relative frequency. 57 */ 58 public Tag(final String name, final int score, final int weight) 59 { 60 this.name = name; 61 this.score = score; 62 this.weight = weight; 63 } 64 65 // ****************************** Inner Classes ***************************** 66 67 // ********************************* Methods ******************************** 68 69 // --- init ----------------------------------------------------------------- 70 71 // --- get&set -------------------------------------------------------------- 72 73 /** 74 * Returns the name of the tag. 75 * 76 * @return the name of the tag. 77 */ 78 public String getName() 79 { 80 return name; 81 } 82 83 /** 84 * Returns the frequency the tag has been used. 85 * 86 * @return the frequency the tag has been used. 87 */ 88 public int getScore() 89 { 90 return score; 91 } 92 93 /** 94 * Returns the relative frequency. 95 * 96 * @return the relative frequency. 97 */ 98 public int getWeight() 99 { 100 return weight; 101 } 102 103 // --- business ------------------------------------------------------------- 104 105 // --- object basics -------------------------------------------------------- 106 107 }