| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- package com.example.yiupang.freefoodfinder;
- import java.util.Date;
- public class Event
- {
- private long eventId;
- private long userId;
- private String name;
- private Date time;
- private String foodType;
- private String description;
- private double lat;
- private double lng;
- public Event(){
- //Empty Constructor
- }
- public Event(String name, String foodType, String description)
- {
- this.name = name;
- this.foodType = foodType;
- this.description = description;
- }
- public String getName() {
- return name;
- }
- public long getEventId() { return eventId;}
- public void setEventId(long id) { eventId = id; }
- public long getUserId(){ return userId; }
- public void setUserId(long id){ userId = id; }
- public Date getTime(){ return time; }
- public void setTime(Date d){ time = d; }
- public boolean setName(String name) {
- if (name.length() > 3 && name.length() < 31) {
- this.name = name;
- return true;
- } else {
- return false;
- }
- }
- public String getFoodType() {
- return foodType;
- }
- public boolean setFoodType(String foodType){
- if(foodType.length() > 3 && foodType.length() <31) {
- this.foodType = foodType;
- return true;
- }
- else{
- return false;
- }
- }
- public double getLat(){
- return lat;
- }
- public boolean setLatitude(double latitude){
- if(latitude >= -90.0 && latitude <= 90.0){
- this.lat = latitude;
- return true;
- }
- else{
- return false;
- }
- }
- public double getLng(){
- return lng;
- }
- public boolean setLongitude(double longitude){
- if(longitude >= -180.0 && longitude <= 180.0){
- this.lng = longitude;
- return true;
- }
- else{
- return false;
- }
- }
- public String getDescription(){return this.description;}
- public void setDescription(String desc){description = desc;}
- @Override
- public String toString(){
- return "name: " + this.name;
- }
- }
|