diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-05 21:14:49 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-05 21:14:49 +0000 |
commit | 8c049462ff6387d8c3f69f4e42a4c4b36e38a90c (patch) | |
tree | 3e6b1ec1ab2e2a724d9228ca55052394c3034060 /sandbox/travelsample/contributions/introducing-tours | |
parent | 68c3920fc0ba41c6a9ebf062bd41e5ebf647e51b (diff) |
Format the code
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@833174 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
2 files changed, 17 insertions, 11 deletions
diff --git a/sandbox/travelsample/contributions/introducing-tours/src/main/java/com/tuscanyscatours/impl/ShoppingCartImpl.java b/sandbox/travelsample/contributions/introducing-tours/src/main/java/com/tuscanyscatours/impl/ShoppingCartImpl.java index 7d2fe8f951..056becf435 100644 --- a/sandbox/travelsample/contributions/introducing-tours/src/main/java/com/tuscanyscatours/impl/ShoppingCartImpl.java +++ b/sandbox/travelsample/contributions/introducing-tours/src/main/java/com/tuscanyscatours/impl/ShoppingCartImpl.java @@ -21,21 +21,26 @@ package com.tuscanyscatours.impl; import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
+
import com.tuscanyscatours.Checkout;
import com.tuscanyscatours.Updates;
public class ShoppingCartImpl implements Checkout, Updates {
- private static List<String> bookedTrips = new ArrayList<String>();
-
+ private static List<String> bookedTrips = new ArrayList<String>();
+
public void makePayment(BigDecimal amount, String cardInfo) {
- System.out.print("Charged $" + amount + " to card " + cardInfo + " for " +
- (bookedTrips.size() > 1 ? "trips" : "trip"));
- for (String trip : bookedTrips){
- System.out.print(" " + trip);
- }
- System.out.println();
- bookedTrips.clear();
+ System.out.print("Charged $" + amount
+ + " to card "
+ + cardInfo
+ + " for "
+ + (bookedTrips.size() > 1 ? "trips" : "trip"));
+ for (String trip : bookedTrips) {
+ System.out.print(" " + trip);
+ }
+ System.out.println();
+ bookedTrips.clear();
}
+
public void addTrip(String resCode) {
bookedTrips.add(resCode);
}
diff --git a/sandbox/travelsample/contributions/introducing-tours/src/main/java/com/tuscanyscatours/impl/TripBookingImpl.java b/sandbox/travelsample/contributions/introducing-tours/src/main/java/com/tuscanyscatours/impl/TripBookingImpl.java index cd1573380c..f2884f87c5 100644 --- a/sandbox/travelsample/contributions/introducing-tours/src/main/java/com/tuscanyscatours/impl/TripBookingImpl.java +++ b/sandbox/travelsample/contributions/introducing-tours/src/main/java/com/tuscanyscatours/impl/TripBookingImpl.java @@ -18,10 +18,11 @@ */
package com.tuscanyscatours.impl;
+import org.osoa.sca.annotations.Reference;
+
import com.goodvaluetrips.Trips;
import com.tuscanyscatours.Bookings;
import com.tuscanyscatours.Updates;
-import org.osoa.sca.annotations.Reference;
public class TripBookingImpl implements Bookings {
@Reference
@@ -29,7 +30,7 @@ public class TripBookingImpl implements Bookings { @Reference
protected Updates cart;
-
+
public String newBooking(String trip, int people) {
String resCode = mytrips.checkAvailability(trip, people);
cart.addTrip(resCode);
|