Save This Page
Home » openjdk-7 » net » sf » rvpf » metadata » [javadoc | source]
    1   /**
    2    * Related Values Processing Framework.
    3    * 
    4    * Copyright (C) 2003 Serge Brisson.
    5    * 
    6    * This software is distributable under LGPL license.
    7    * See details at the bottom of this file.
    8    * 
    9    * $Header: /cvsroot/rvpf/RVPF/java/src/net/sf/rvpf/metadata/Relation.java,v 1.2 2003/10/07 01:53:19 sfb Exp $
   10    */
   11   package net.sf.rvpf.metadata;
   12   
   13   import java.util.Collections;
   14   import java.util.Iterator;
   15   import java.util.LinkedList;
   16   import java.util.List;
   17   
   18   
   19   /** Relation.
   20    * 
   21    * @author Serge Brisson
   22    * @version $Revision: 1.2 $
   23    */
   24   public class Relation implements Input, Result {
   25   
   26       // Constructors.
   27       
   28       public Relation(PointEntity inputPoint, PointEntity resultPoint) {
   29           this.inputPoint = inputPoint;
   30           this.resultPoint = resultPoint;
   31       }
   32   
   33       // Instance Properties.
   34   
   35       /**
   36        */
   37       public List getBehaviours() {
   38           if (this.behaviours == null) return Collections.EMPTY_LIST;
   39   
   40           return this.behaviours;
   41       }
   42   
   43       /**
   44        */
   45       public Params getParams() {
   46           return this.params;
   47       }
   48   
   49       /** Sets the Params of this InputRelation.
   50        * 
   51        * @param params The Params.
   52        */
   53       public void setParams(Params params) {
   54           this.params = params;
   55       }
   56   
   57       /**
   58        */
   59       public Point getInputPoint() {
   60           return this.inputPoint;
   61       }
   62   
   63       /** Gets the PointEntity of the Input.
   64        * 
   65        * @return The PointEntity.
   66        */
   67       public PointEntity getPointEntity() {
   68           return this.inputPoint;
   69       }
   70   
   71       /**
   72        */
   73       public Point getResultPoint() {
   74           return this.resultPoint;
   75       }
   76   
   77       // Public Instance Methods.
   78   
   79       /** Adds a BehaviourEntity to this Relation.
   80        * 
   81        * @param behaviour The BehaviourEntity.
   82        */
   83       public void addBehaviourEntity(BehaviourEntity behaviour) {
   84           if (this.behaviours == null) this.behaviours = new LinkedList();
   85   
   86           this.behaviours.add(behaviour);
   87       }
   88   
   89       /** Sets up this Point.
   90        * 
   91        * @param metadata The Metadata.
   92        * @return True if successful.
   93        */
   94       public boolean setUp(Metadata metadata) {
   95           if (this.behaviours != null)
   96               for (Iterator i = this.behaviours.iterator(); i.hasNext(); )
   97                   if (!((BehaviourEntity) i.next()).setUp(metadata)) return false;
   98   
   99           return true;
  100       }
  101   
  102       /** Tears down what has been set up.
  103        */
  104       public void tearDown() {
  105           if (this.behaviours != null)
  106               for (Iterator i = this.behaviours.iterator(); i.hasNext(); )
  107                   ((BehaviourEntity) i.next()).tearDown();
  108       }
  109   
  110       // Instance Attributes.
  111   
  112       private List behaviours = null;
  113       private PointEntity inputPoint = null;
  114       private Params params = null;
  115       private PointEntity resultPoint = null;
  116   }
  117   
  118   // $Log: Relation.java,v $
  119   // Revision 1.2  2003/10/07 01:53:19  sfb
  120   // Modified to allow multiple behaviours per Relation.
  121   //
  122   
  123   /*
  124    * This is free software; you can redistribute it and/or modify
  125    * it under the terms of the GNU Lesser General Public License
  126    * as published by the Free Software Foundation; either version 2.1
  127    * of the License, or (at your option) any later version.
  128    *
  129    * This software is distributed in the hope that it will be useful,
  130    * but WITHOUT ANY WARRANTY; without even the implied warranty of
  131    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  132    * Lesser General Public License for more details.
  133    *
  134    * You should have received a copy of the GNU Lesser General Public
  135    * License along with this software; if not, write to the Free Software
  136    * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  137    */

Save This Page
Home » openjdk-7 » net » sf » rvpf » metadata » [javadoc | source]