public void insert(Halfedge halfEdge) {
        Halfedge previous, next;
        int insertionBucket = bucket(halfEdge);
        if (insertionBucket < _minBucket) {
            _minBucket = insertionBucket;
        }
        previous = _hash.get(insertionBucket);
        while ((next = previous.nextInPriorityQueue) != null
                && (halfEdge.ystar > next.ystar || (halfEdge.ystar == next.ystar && halfEdge.vertex.get_x() > next.vertex.get_x()))) {
            previous = next;
        }
        halfEdge.nextInPriorityQueue = previous.nextInPriorityQueue;
        previous.nextInPriorityQueue = halfEdge;
        ++_count;
    }