aaa.java

来自「用于GIS(全球地理系统)的分析和处理的代码。」· Java 代码 · 共 111 行

JAVA
111
字号
/*
 * This file is part of the GeOxygene project source files. 
 * 
 * GeOxygene aims at providing an open framework which implements OGC/ISO specifications for 
 * the development and deployment of geographic (GIS) applications. It is a open source 
 * contribution of the COGIT laboratory at the Institut G閛graphique National (the French 
 * National Mapping Agency).
 * 
 * See: http://oxygene-project.sourceforge.net 
 *  
 * Copyright (C) 2005 Institut G閛graphique National
 *
 * This library is free software; you can redistribute it and/or modify it under the terms
 * of the GNU Lesser General Public License as published by the Free Software Foundation; 
 * either version 2.1 of the License, or any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT ANY 
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
 * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License along with 
 * this library (see file LICENSE if present); if not, write to the Free Software 
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *  
 */

package fr.ign.cogit.geoxygene.example.relations;

// Imports necessaires aux relations 1-n et n-m    
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;


/** 
 * Classe exemple pour les relations mono ou bidirectionnelles, avec la classe BBB.
 * Les relations peuvent etre persistantes ou non (cf. fichier de mapping repository_AAA_BBB.xml)
 * 
 * @author Thierry Badard, Arnaud Braun & S閎astien Musti鑢e
 * @version 1.0
 * 
 */


public class AAA extends ClasseMere {



//////////////////////////////////////////////////////////////////////////    
//////////////////////////////////////////////////////////////////////////    
//////////////////////////////////////////////////////////////////////////    
///                                                                  /////
///                        R E L A T I O N S                         /////
///                 B I D I R E C T I O N N E L L E S                /////
///                                                                  /////
//////////////////////////////////////////////////////////////////////////    
//////////////////////////////////////////////////////////////////////////    
//////////////////////////////////////////////////////////////////////////    

//////////////////////////////////////////////////////////////////////////    
//      relation     BIDIRECTIONNELLE     1-1     ////////////////////////
//////////////////////////////////////////////////////////////////////////    
    
    /** Lien bidirectionnel  1-1 vers BBB. 
     *  1 objet AAA est en relation avec 1 objet BBB au plus.             
     *  1 objet BBB est en relation avec 1 objet AAA au plus.
     *             
     *  Les m閠hodes get et set sont utiles pour assurer la bidirection.
     *
     *  NB : si il n'y a pas d'objet en relation, getObjet renvoie null. 
     *  Pour casser une relation: faire setObjet(null);
     */
    private BBB objetBBB_bi11;

    /** R閏up鑢e l'objet en relation */
    public BBB getObjetBBB_bi11() {return objetBBB_bi11;}
    
    /** D閒init l'objet en relation */
    public void setObjetBBB_bi11(BBB O) {
        BBB old = objetBBB_bi11;
        objetBBB_bi11 = O;
        if ( old != null ) old.setObjetAAA_bi11(null);
        if ( O != null ) {
            if ( O.getObjetAAA_bi11() != this ) O.setObjetAAA_bi11(this);
        }
    }


//////////////////////////////////////////////////////////////////////////    
//      relation     BIDIRECTIONNELLE     1-n     ////////////////////////
//////////////////////////////////////////////////////////////////////////    

    /** Lien bidirectionnel 1-n vers BBB. 
     *  1 objet AAA est en relation avec n objets BBB (n pouvant etre nul).             
     *  1 objet BBB est en relation avec 1 objet AAA au plus.
     *
     *  NB: un objet AAA ne doit pas 阾re en relation plusieurs fois avec le m阭e objet BBB :
     *  il est impossible de bien g閞er des relations 1-n bidirectionnelles avec doublons.
     *
     *  ATTENTION: Pour assurer la bidirection, il faut modifier les listes uniquement avec 
     *  les methodes fournies.
     * 
     *  NB: si il n'y a pas d'objet en relation, la liste est vide mais n'est pas "null".
     *  Pour casser toutes les relations, faire setListe(new ArrayList()) ou emptyListe().
     */
    private List liste_objetsBBB_bi1N = new ArrayList();   

    /** R閏up鑢e la liste des objets en relation. */
    public List getListe_objetsBBB_bi1N() {return liste_objetsBBB_bi1N ; } 
    
    /** D閒init la liste des objets en relation, et met 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?