01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2004-2006, GeoTools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * Created on 07 December 2004, 16:29
17: */
18:
19: package org.geotools.filter;
20:
21: import org.opengis.filter.expression.ExpressionVisitor;
22: import org.opengis.filter.expression.Literal;
23:
24: /**
25: * This class is actualy a place holder. It resolves to 1.0 but should actualy be substituted for
26: * a literal that actualy contains the current map scale before use.
27: * @author James
28: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/main/src/main/java/org/geotools/filter/MapScaleDenominatorImpl.java $
29: *
30: */
31: public class MapScaleDenominatorImpl extends DefaultExpression
32: implements MapScaleDenominator, Literal {
33:
34: /** Creates a new instance of MapScaleDenominatorImpl */
35: public MapScaleDenominatorImpl() {
36:
37: }
38:
39: public Object evaluate(Object f) {
40: return getValue();
41: }
42:
43: public Object getValue() {
44: return new Double(1);
45: }
46:
47: public void setValue(Object constant) {
48: throw new UnsupportedOperationException();
49: }
50:
51: public Object accept(ExpressionVisitor visitor, Object extraData) {
52: return visitor.visit(this , extraData);
53: }
54:
55: public String toString() {
56: return MapScaleDenominator.EV_NAME;
57: }
58: }
|