eu.xtreemos.xosd.localallocmgr.basic.manipulators
Class TimeTableAdd

java.lang.Object
  extended by eu.xtreemos.xosd.localallocmgr.basic.manipulators.TimeTableAdd

public class TimeTableAdd
extends java.lang.Object

basic manipulator that adds elements to the timetable.

Author:
urosjovanovic

Constructor Summary
TimeTableAdd()
           
 
Method Summary
private static boolean add(TimeTable tt, TTElm newelm)
          when the join operation returns the array of elements the new elements need to be identified and if new one is introduced, it needs to be added.
static boolean addElm(TimeTable tt, TTElm newelm)
           
private static boolean endsBefore(TTElm stored, java.util.GregorianCalendar newStart)
           
private static void handleException(TTElmJoinException e)
           
private static boolean hasIntersection(TTElm stored, TTElm newelm, java.util.GregorianCalendar newStart)
           
private static boolean isBefore(TTElm stored, java.util.GregorianCalendar newStart)
          check if the ttelm starts before the new element
private static boolean isCompleteBefore(TTElm stored, TTElm newelm)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeTableAdd

public TimeTableAdd()
Method Detail

addElm

public static boolean addElm(TimeTable tt,
                             TTElm newelm)
                      throws AttributeConformanceException
Throws:
AttributeConformanceException

add

private static boolean add(TimeTable tt,
                           TTElm newelm)
                    throws AttributeConformanceException
when the join operation returns the array of elements the new elements need to be identified and if new one is introduced, it needs to be added. before joining, the elements in question must be stored in a transaction. when something goes wrong, restore all objects in question. Note: store only the object that are already present in the table.

Parameters:
newelm -
Throws:
AttributeConformanceException

handleException

private static void handleException(TTElmJoinException e)

isBefore

private static boolean isBefore(TTElm stored,
                                java.util.GregorianCalendar newStart)
                         throws AttributeConformanceException
check if the ttelm starts before the new element

Parameters:
stored -
newStart -
Returns:
Throws:
AttributeConformanceException

isCompleteBefore

private static boolean isCompleteBefore(TTElm stored,
                                        TTElm newelm)
                                 throws AttributeConformanceException
Throws:
AttributeConformanceException

endsBefore

private static boolean endsBefore(TTElm stored,
                                  java.util.GregorianCalendar newStart)
                           throws AttributeConformanceException
Throws:
AttributeConformanceException

hasIntersection

private static boolean hasIntersection(TTElm stored,
                                       TTElm newelm,
                                       java.util.GregorianCalendar newStart)
                                throws AttributeConformanceException
Throws:
AttributeConformanceException