@staticmethod
def _calculateIntervalResult(list, timeStamp, positiveResult, negativeResult):
    """
        A helper function to calculate black interval results or white interval
        results.

        :param list list: The set of RepetitiveInterval, which can be the white
          list or the black list.
        :param float timeStamp: The time stamp as milliseconds since Jan 1,
          1970 UTC.
        :param Interval positiveResult: The positive result which is updated.
        :param Interval negativeResult: The negative result which is updated.
        """
    for i in range(len(list)):
        element = list[i]
        result = element.getInterval(timeStamp)
        tempInterval = result.interval
        if result.isPositive == True:
            positiveResult.unionWith(tempInterval)
        elif not negativeResult.isValid():
            negativeResult.set(tempInterval)
        else:
            negativeResult.intersectWith(tempInterval)
