All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ingenias.editor.entities.AssociationEnd Maven / Gradle / Ivy

Go to download

Meta-language editor built over INGENME. It is the most basic editor to be used in the rest of projects

There is a newer version: 1.0.9
Show newest version


/** 
 * Copyright (C) 2010  Jorge J. Gomez-Sanz over original code from Ruben Fuentes
 * 
 * 
 * This file is part of the INGENME tool. INGENME is an open source meta-editor
 * which produces customized editors for user-defined modeling languages
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation version 3 of the License
 *
 * This program 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 General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see 
 **/

package ingenias.editor.entities;
import java.util.*;

import ingenias.editor.TypedVector;

public class AssociationEnd extends NAryEdgeEntity {


  public java.lang.String MaxCardinality;

  public java.lang.String MinCardinality;

  public java.lang.String SourceOrTarget;




  public AssociationEnd(String id) {
    super(id);
    ModelEntity em=null;
  }






  
      public java.lang.String getMaxCardinality(){
        return MaxCardinality;
      }
   public void setMaxCardinality(java.lang.String
					MaxCardinality){
        this.MaxCardinality=MaxCardinality;
      }

      public java.lang.String getMinCardinality(){
        return MinCardinality;
      }
   public void setMinCardinality(java.lang.String
					MinCardinality){
        this.MinCardinality=MinCardinality;
      }

      public java.lang.String getSourceOrTarget(){
        return SourceOrTarget;
      }
   public void setSourceOrTarget(java.lang.String
					SourceOrTarget){
        this.SourceOrTarget=SourceOrTarget;
      }



public void fromMap(Map ht){
super.fromMap(ht);

 if (ht.get("MaxCardinality")!=null && ht.get("MaxCardinality").equals(""))
  this.setMaxCardinality(null);
 else
  if (ht.get("MaxCardinality")!=null)
   this.setMaxCardinality(new java.lang.String(ht.get("MaxCardinality").toString()));

 if (ht.get("MinCardinality")!=null && ht.get("MinCardinality").equals(""))
  this.setMinCardinality(null);
 else
  if (ht.get("MinCardinality")!=null)
   this.setMinCardinality(new java.lang.String(ht.get("MinCardinality").toString()));

 if (ht.get("SourceOrTarget")!=null && ht.get("SourceOrTarget").equals(""))
  this.setSourceOrTarget(null);
 else
  if (ht.get("SourceOrTarget")!=null)
   this.setSourceOrTarget(new java.lang.String(ht.get("SourceOrTarget").toString()));



}
public void toMap(Map ht){
super.toMap(ht);

//if (this.getMaxCardinality() instanceof String)
 if (this.getMaxCardinality()!=null)
 	ht.put("MaxCardinality",this.getMaxCardinality().toString());
 else	
 	ht.put("MaxCardinality","");

//if (this.getMinCardinality() instanceof String)
 if (this.getMinCardinality()!=null)
 	ht.put("MinCardinality",this.getMinCardinality().toString());
 else	
 	ht.put("MinCardinality","");

//if (this.getSourceOrTarget() instanceof String)
 if (this.getSourceOrTarget()!=null)
 	ht.put("SourceOrTarget",this.getSourceOrTarget().toString());
 else	
 	ht.put("SourceOrTarget","");


}


public String toString(){
 return getId()+":"+getType();
}



}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy