DimensionSubsetDate.java

Go to the documentation of this file.
00001 /*
00002  * DimensionSubsetDate.java
00003  *
00004  *  Copyright (C) 2003 Alain MENSEGUEN
00005  *  www.net2map.org
00006  *
00007  *  This program is free software; you can redistribute it and/or
00008  *  modify it under the terms of the GNU General Public License
00009  *  as published by the Free Software Foundation; either version 2
00010  *  of the License, or (at your option) any later version.
00011  *
00012  *  This program is distributed in the hope that it will be useful,
00013  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  *  GNU Lesser General Public License for more details.
00016  *
00017  *  You should have received a copy of the GNU General Public License
00018  *  along with this program; if not, write to the Free Software
00019  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00020  */
00021 package org.net2map.pov.server;
00022 
00023 import java.beans.*;
00024 
00029 public class DimensionSubsetDate extends DimensionSubset
00030 {
00031     private long earliestDate;
00032     private long latestDate;
00033     private ParameterSet pParameters;
00034 
00040     public DimensionSubsetDate( long earliest, long latest, ParameterSet params )
00041     {
00042         earliestDate = earliest;
00043         latestDate = latest;
00044         pParameters = params;
00045     }
00046     
00050     public long getEarliestDate()
00051     {
00052         return earliestDate;
00053     }
00054     
00058     public long getLatestDate()
00059     {
00060         return latestDate;
00061     }
00062     
00066     public void setEarliestDate( long date )
00067     {
00068         earliestDate = date;
00069     }
00070     
00074     public void setLatestDate( long date )
00075     {
00076         latestDate = date;
00077     }
00078     
00081     public void buildSubset()
00082     {
00083         Query qResult = new Query( pParameters );
00084         qResult.setSelect( "dimension.url_id,dimension.last_mod_time" );
00085         qResult.setFrom( "dimension" );
00086         //qResult.setWhere ("dimension.last_mod_time >= " + earliestDate + " and dimension.last_mod_time <= " + latestDate );
00087         qResult.setWhere ("dimension.last_mod_time between " + earliestDate + " and " + latestDate );
00088         
00089         qResult.getDimensionFields().addDimensionField( "dimension.url_id", "dimension.url_id", true, false );
00090         qResult.getDimensionFields().addDimensionField( "dimension.last_mod_time", "dimension.last_mod_time", false, false );
00091         qResult.getDimensionTables().addDimensionTable( "dimension", "dimension" );
00092         qResult.setFieldToJoin( "dimension.url_id" );
00093 
00094         if( pParameters.DEBUG > 2 ) System.out.println( "Dimension date built using query " + qResult.toString() );
00095         
00096         this.setSubsetQuery( qResult );
00097     }
00098 }
Accueil | Téléchargement | Manuel | Doc. technique | Sources CVS | Faq | Nous contacter
©2003 - All Rights Reserved