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

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

There is a newer version: 1.0.11
Show newest version

/** 
 * Copyright (C) 2010  Jorge J. Gomez-Sanz
 * 
 * 
 * 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 SDate extends Entity {


  public java.lang.Integer YearField;

  public java.lang.Integer DayField;

  public java.lang.Integer SecondField;

  public java.lang.Integer MinuteField;

  public java.lang.Integer HoursField;

  public java.lang.String Description;

  public java.lang.Integer HourField;

  public java.lang.Integer MonthField;





  public SDate(String id) {
    super(id);
    this.setHelpDesc("");
    this.setHelpRecom("");
  }


      public java.lang.Integer getYearField(){
        return YearField;
      }
       public void setYearField(java.lang.Integer
					YearField){
        this.YearField=YearField;
      }


      public java.lang.Integer getDayField(){
        return DayField;
      }
       public void setDayField(java.lang.Integer
					DayField){
        this.DayField=DayField;
      }


      public java.lang.Integer getSecondField(){
        return SecondField;
      }
       public void setSecondField(java.lang.Integer
					SecondField){
        this.SecondField=SecondField;
      }


      public java.lang.Integer getMinuteField(){
        return MinuteField;
      }
       public void setMinuteField(java.lang.Integer
					MinuteField){
        this.MinuteField=MinuteField;
      }


      public java.lang.Integer getHoursField(){
        return HoursField;
      }
       public void setHoursField(java.lang.Integer
					HoursField){
        this.HoursField=HoursField;
      }


      public java.lang.String getDescription(){
        return Description;
      }
       public void setDescription(java.lang.String
					Description){
        this.Description=Description;
      }


      public java.lang.Integer getHourField(){
        return HourField;
      }
       public void setHourField(java.lang.Integer
					HourField){
        this.HourField=HourField;
      }


      public java.lang.Integer getMonthField(){
        return MonthField;
      }
       public void setMonthField(java.lang.Integer
					MonthField){
        this.MonthField=MonthField;
      }





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

 if (ht.get("YearField")!=null && ht.get("YearField").equals(""))
  this.setYearField(null);
 else
  if (ht.get("YearField")!=null)
   this.setYearField(new java.lang.Integer(ht.get("YearField").toString()));

 if (ht.get("DayField")!=null && ht.get("DayField").equals(""))
  this.setDayField(null);
 else
  if (ht.get("DayField")!=null)
   this.setDayField(new java.lang.Integer(ht.get("DayField").toString()));

 if (ht.get("SecondField")!=null && ht.get("SecondField").equals(""))
  this.setSecondField(null);
 else
  if (ht.get("SecondField")!=null)
   this.setSecondField(new java.lang.Integer(ht.get("SecondField").toString()));

 if (ht.get("MinuteField")!=null && ht.get("MinuteField").equals(""))
  this.setMinuteField(null);
 else
  if (ht.get("MinuteField")!=null)
   this.setMinuteField(new java.lang.Integer(ht.get("MinuteField").toString()));

 if (ht.get("HoursField")!=null && ht.get("HoursField").equals(""))
  this.setHoursField(null);
 else
  if (ht.get("HoursField")!=null)
   this.setHoursField(new java.lang.Integer(ht.get("HoursField").toString()));

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

 if (ht.get("HourField")!=null && ht.get("HourField").equals(""))
  this.setHourField(null);
 else
  if (ht.get("HourField")!=null)
   this.setHourField(new java.lang.Integer(ht.get("HourField").toString()));

 if (ht.get("MonthField")!=null && ht.get("MonthField").equals(""))
  this.setMonthField(null);
 else
  if (ht.get("MonthField")!=null)
   this.setMonthField(new java.lang.Integer(ht.get("MonthField").toString()));



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

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

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

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

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

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

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

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

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


}

public String toString(){
/*if (this.getId()==null ||
    this.getId().toString().equals(""))
 return "Please, define the value of field Id";
else
 return this.getId().toString();*/
return ""+getId();
}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy