function TripController($scope, WizardHandler) { 'use strict'; $scope.trip = new Trip(); $scope.addTrip = function () { // ... } $scope.finished = function () { this.addTrip (); this.trip = new Trip(); WizardHandler.wizard().goTo(0); } }
for(int i = 0; i < tripArray.length(); i++){ JSONObject tripInstance = tripArray.getJSONObject(i); Trip thisTrip = new Trip(); thisTrip.origin = tripInstance.getString("origin"); thisTrip.destination = tripInstance.getString("destination"); thisTripList.add(thisTrip); }
public ArrayList<Trip> getTripList(String json){ Trip thisTrip; ArrayList<Trip> thisTripList = new ArrayList<Trip>(); try { JSONObject jsonObject = new JSONObject(json); JSONArray tripArray = jsonObject.getJSONArray("trips"); for(int i = 0; i < tripArray.length(); i++){ JSONObject tripInstance = tripArray.getJSONObject(i); thisTrip = new Trip(); thisTrip.origin = tripInstance.getString("origin"); thisTrip.destination = tripInstance.getString("destination"); thisTripList.add(thisTrip); } return(thisTripList); } catch (JSONException e) { e.printStackTrace(); return(null); } }
Trip trip = new Trip(); trip.setOrigin(tripArray.getJSONObject(i).getString("origin")); trip.setDestination(tripArray.getJSONObject(i).getString("destination"));
System.out.println("Please enter a positive number"); System.out.println((new Trip(miles, gallons)).getMPG());
System.out.println("Please enter a positive number"); calc.add(new Trip(miles, gallons));
Trip newTrip = new Trip(trip); String id = newTrip.getId().getId(); if (preIndex != null) {
Trip newTrip = new Trip(trip); String id = newTrip.getId().getId(); if (fromIndex != null) {
private Trip createTrip(GtfsMutableRelationalDao dao, Trip referenceTrip, Trip atisTrip) { Trip trip = new Trip(); trip.setRoute(atisTrip.getRoute()); trip.setId(referenceTrip.getId()); trip.setTripHeadsign(atisTrip.getTripHeadsign()); trip.setDirectionId(atisTrip.getDirectionId()); trip.setShapeId(atisTrip.getShapeId()); trip.setPeakOffpeak(atisTrip.getPeakOffpeak()); trip.setMtaTripId(referenceTrip.getId().getId()); dao.saveOrUpdateEntity(trip); //_log.info("Created new trip: {}", trip.getId().getId()); return trip; }