01: /*
02: * This file is part of the GeOxygene project source files.
03: *
04: * GeOxygene aims at providing an open framework which implements OGC/ISO specifications for
05: * the development and deployment of geographic (GIS) applications. It is a open source
06: * contribution of the COGIT laboratory at the Institut Géographique National (the French
07: * National Mapping Agency).
08: *
09: * See: http://oxygene-project.sourceforge.net
10: *
11: * Copyright (C) 2005 Institut Géographique National
12: *
13: * This library is free software; you can redistribute it and/or modify it under the terms
14: * of the GNU Lesser General Public License as published by the Free Software Foundation;
15: * either version 2.1 of the License, or any later version.
16: *
17: * This library is distributed in the hope that it will be useful, but WITHOUT ANY
18: * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
19: * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
20: *
21: * You should have received a copy of the GNU Lesser General Public License along with
22: * this library (see file LICENSE if present); if not, write to the Free Software
23: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24: *
25: */
26:
27: package fr.ign.cogit.geoxygene.spatial.topoprim;
28:
29: /**
30: * non utilisé. Cette classe est cependant présente dans la norme.
31: * Terme de l'expression polynomiale TP_Expression : un coefficient (égal à +1, -1 ou 0)
32: * et une variable (TP_DirectedTopo).
33: * Il me parait plus simple d'utiliser directement le TP_DirectedTopo comme variable, et
34: * l'orientation comme coefficient.
35: *
36: * @author Thierry Badard & Arnaud Braun
37: * @version 1.0
38: *
39: */
40:
41: class TP_ExpressionTerm {
42:
43: /** Le coefficient. Vaut +1 par défaut.*/
44: protected int coefficient = 1;
45:
46: /** Renvoie le coefficient. */
47: public int getCoefficient() {
48: return this .coefficient;
49: }
50:
51: /**La variable.*/
52: protected TP_DirectedTopo variable;
53:
54: /** Renvoie la variable. */
55: public TP_DirectedTopo getVariable() {
56: return this .variable;
57: }
58:
59: /** Constructeur par défaut. */
60: public TP_ExpressionTerm() {
61: coefficient = 1;
62: variable = null;
63: }
64:
65: /** Constructeur à partir d'un TP_DirectedTopo. Affecte +1 au coefficient. */
66: public TP_ExpressionTerm(TP_DirectedTopo dt) {
67: coefficient = 1;
68: variable = dt;
69: }
70:
71: /** Constructeur à partir d'un TP_DirectedTopo et d'un coefficient. */
72: public TP_ExpressionTerm(int coeff, TP_DirectedTopo dt) {
73: if ((coeff == -1) || (coeff == 0) || (coeff == +1)) {
74: coefficient = coeff;
75: variable = dt;
76: } else
77: System.out.println("coeff = +-1");
78: }
79:
80: }
|