static public Result insertElements ( Tree tree , List < TreeElement > elements , NowReference now ) throws Exception { ResultImpl result = new ResultImpl ( tree ) ; TreeNodeRegular regularRootNode = tree . getRegularRootNode ( ) ; TreeNodeOngoing ongoingRootNode = tree . getOngoingRootNode ( ) ; for ( TreeElement element : elements ) { TimeInterval elementInterval = element . getInterval ( ) ; if ( elementInterval . isOngoing ( ) ) { ongoingRootNode . insertElement ( element , result , tree . getOperations ( ) , now ) ; } else { regularRootNode . insertElement ( element , result , tree . getOperations ( ) , now ) ; } } return result ; }
Modifies a cluster tree as a result of adding a new elements in the tree .