001 /**
002 * www.jcoverage.com
003 * Copyright (C)2003 jcoverage ltd.
004 *
005 * This file is part of jcoverage.
006 *
007 * jcoverage is free software; you can redistribute it and/or modify
008 * it under the terms of the GNU General Public License as published
009 * by the Free Software Foundation; either version 2 of the License,
010 * or (at your option) any later version.
011 *
012 * jcoverage is distributed in the hope that it will be useful, but
013 * WITHOUT ANY WARRANTY; without even the implied warranty of
014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015 * General Public License for more details.
016 *
017 * You should have received a copy of the GNU General Public License
018 * along with jcoverage; if not, write to the Free Software
019 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
020 * USA
021 *
022 */
023 package com.jcoverage.reporting;
024
025 import java.util.Collection;
026 import java.util.Collections;
027 import java.util.HashSet;
028 import java.util.Set;
029 import org.apache.log4j.Logger;
030
031 /**
032 * Default line category.
033 */
034 public class DefaultLineCategory implements LineCategory {
035
036 static Logger logger=Logger.getLogger(DefaultLineCategory.class);
037
038 String name,description;
039 Set columns=new HashSet();
040
041 public DefaultLineCategory(String name,String description) {
042 this.name=name;
043 this.description=description;
044 }
045
046 public DefaultLineCategory(String name) {
047 this(name,"");
048 }
049
050 public void addColumn(Column column) {
051 columns.add(column);
052 }
053
054 public Collection getColumns() {
055 return Collections.unmodifiableCollection(columns);
056 }
057
058 public String toString() {
059 return "["+name+"]";
060 }
061
062 }