'Ctor.
Args:
entity_iterator: an iterator of entities which will be wrapped.
orderings: an iterable of (identifier, order) pairs. order
should be either Query.ASCENDING or Query.DESCENDING.'

def __init__(self, entity_iterator, orderings):

    self.__entity_iterator = entity_iterator
    self.__entity = None
    self.__min_max_value_cache = {}
    try:
        self.__entity = entity_iterator.next()
    except StopIteration:
        pass
    else:
        self.__orderings = orderings
