DimensionSubsetList.java

Go to the documentation of this file.
00001 /* 
00002 *  Copyright (C) 2003 Philippe MOULIN
00003  *  www.net2map.org
00004  *
00005  *  This program is free software; you can redistribute it and/or
00006  *  modify it under the terms of the GNU General Public License
00007  *  as published by the Free Software Foundation; either version 2
00008  *  of the License, or (at your option) any later version.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU Lesser General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with this program; if not, write to the Free Software
00017  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018  */
00019 
00020 package org.net2map.pov.dimension;
00021 /*
00022  * DimensionSubsetList.java
00023  *
00024  * Created on 19 mars 2003, 16:04
00025  */
00026 
00027 import java.util.*;
00028 
00033 public class DimensionSubsetList
00034 {
00035     private static org.apache.log4j.Logger logger = 
00036     org.apache.log4j.Logger.getLogger(DimensionSubsetList.class.getName());
00038     public DimensionSubsetList ()
00039     {
00040         logger.setLevel((org.apache.log4j.Level)org.apache.log4j.Priority.DEBUG);
00041         logger.warn("Creating...");
00042         
00043         logger.warn("...Created");
00044     }
00045     
00046     private LinkedList colSubsets = new LinkedList();
00047     
00048     public void addSubset(Subset s)
00049     {
00050         s.setOrderNb( colSubsets.size() + 1 );
00051         colSubsets.add( s );
00052     }
00053     
00054 /*    public void addSubset( int index, DimensionSubset s)
00055     {
00056         colSubsets.add( index, s );
00057     }*/
00058     
00059     public Subset getSubset( int n )
00060     {
00061         return (Subset)colSubsets.get( n );
00062     }
00063     
00064     public long count()
00065     {
00066         return colSubsets.size();
00067     }
00068     
00069     public void removeSubset( int n )
00070     {
00071         colSubsets.remove( n );
00072     }
00073         
00078     public int exists( String criterianame )
00079     {
00080         for ( int i = 0; i < count(); i++ )
00081         {
00082             if ( getSubset( i ).getClass().getName() == criterianame ) return i;
00083         }
00084         return -1;
00085     }
00086         
00088     public String toString()
00089     {
00090         String result = "";
00091         for ( int i = 0; i < count(); i++ )
00092         {
00093             result += "[" + i + "]" + getSubset( i ).getClass().getName() + " : " + getSubset( i ).toString() + "\n";
00094         }
00095         return result;
00096     }
00097         
00099     public String toXml()
00100     {
00101         //String result = "<CriteriasSet>\n";
00102         String result = "";
00103         for ( int i = 0; i < count(); i++ )
00104         {
00105             result += getSubset( i ).toXml();
00106         }
00107         //result += "</CriteriasSet>";
00108         return result;
00109     }
00110 }
Accueil | Téléchargement | Manuel | Doc. technique | Sources CVS | Faq | Nous contacter
©2003 - All Rights Reserved