Example usage for java.util Deque removeAll

List of usage examples for java.util Deque removeAll

Introduction

In this page you can find the example usage for java.util Deque removeAll.

Prototype

boolean removeAll(Collection<?> c);

Source Link

Document

Removes all of this collection's elements that are also contained in the specified collection (optional operation).

Usage

From source file:edu.byu.nlp.al.EmpiricalAnnotationInstanceManager.java

private void prioritizeMeasurements(Deque<FlatInstance<D, L>> measurementDeque,
        boolean prioritizeLabelProportions) {
    if (prioritizeLabelProportions) {
        // get a list of all the labeled proportion measurements 
        ArrayList<FlatInstance<D, L>> proportions = Lists.newArrayList();
        for (FlatInstance<D, L> inst : measurementDeque) {
            Measurement meas = inst.getMeasurement();
            if (meas instanceof BasicClassificationLabelProportionMeasurement) {
                proportions.add(inst);/*from ww  w .ja  va2  s . c o  m*/
            }
        }
        // move them to the front of the line
        measurementDeque.removeAll(proportions);
        for (FlatInstance<D, L> prop : proportions) {
            measurementDeque.push(prop);
        }
    }
}