/* * The CroudTrip! application aims at revolutionizing the car-ride-sharing market with its easy, * user-friendly and highly automated way of organizing shared Trips. Copyright (C) 2015 Nazeeh Ammari, * Philipp Eichhorn, Ricarda Hohn, Vanessa Lange, Alexander Popp, Frederik Simon, Michael Weber * This program is free software: you can redistribute it and/or modify it under the terms of the GNU * Affero General Public License as published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * 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 Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License along with this program. * If not, see http://www.gnu.org/licenses/. */ package org.croudtrip.utils; /** Used to exchange data between fragments * Created by nazeehammari on 12/05/15. */ public class DataHolder { private static DataHolder dataObject = null; private DataHolder() { } public static DataHolder getInstance() { if (dataObject == null) dataObject = new DataHolder(); return dataObject; } private boolean isLast = false; private int vehicle_id; private String vehicle_type; public int getVehicle_id() { return vehicle_id; } public void setVehicle_id(int vehicle_id) { this.vehicle_id = vehicle_id; } public String getVehicle_type() {return vehicle_type;} public void setVehicle_type(String vehicle_type) {this.vehicle_type = vehicle_type;} //isLast is a flag that should be set to true when there is only one car left, in order to default to it automatically public boolean getIsLast() { return isLast; } public void setIsLast(boolean isLast) { this.isLast = isLast; } }