DataHandler angepasst
[staff/due1/sed-hs15-srs-purple.git] / src / main / java / ch / bfh / ti / srs / datahandler / DataHandlerForTests.java
index 65199a6..8f33e83 100644 (file)
@@ -7,8 +7,11 @@
  */
 package ch.bfh.ti.srs.datahandler;
 
+import java.util.ArrayList;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Set;
+import java.util.UUID;
 
 import ch.bfh.ti.daterange.DateRange;
 import ch.bfh.ti.srs.dataschema.Reservation;
@@ -69,12 +72,29 @@ public class DataHandlerForTests implements DataHandler{
         * @see ch.bfh.ti.srs.dataschema.DataHandler#findReservation(java.lang.String)
         */
        @Override
-       public Reservation findReservation(Resource resource, DateRange daterange) {
+       public Reservation findReservation(UUID id) {
                for (Reservation reservation : reservationList) {
-                       if(reservation.getResource().equals(resource) && reservation.getDateRange().equals(daterange)) return reservation;
+                       if(reservation.getId().equals(id)) return reservation;
                }
                return null;
        }
+       
+       @Override
+       public List<Reservation> findGroupReservations(UUID groupID) {
+               List<Reservation> groupReservations = new ArrayList<Reservation>();
+               for (Reservation reservation : reservationList) {
+                       if(reservation.getGroupId().equals(groupID))
+                               groupReservations.add(reservation);
+               }
+               return groupReservations;
+       }
+
+       @Override
+       public List<Reservation> overlaps(DateRange range) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+       
        /* (non-Javadoc)
         * @see ch.bfh.ti.srs.dataschema.DataHandler#addReservation(ch.bfh.ti.srs.dataschema.Reservation)
         */
@@ -84,4 +104,5 @@ public class DataHandlerForTests implements DataHandler{
                if(resourceList.contains(reservation)) throw new IllegalArgumentException("Reservation already  exists!");
                reservationList.add(reservation);       
        }
+
 }