Example usage for android.support.v4.util ArraySet addAll

List of usage examples for android.support.v4.util ArraySet addAll

Introduction

In this page you can find the example usage for android.support.v4.util ArraySet addAll.

Prototype

@Override
public boolean addAll(Collection<? extends E> collection) 

Source Link

Document

Perform an #add(Object) of all values in collection

Usage

From source file:cc.metapro.openct.data.university.model.classinfo.EnrichedClassInfo.java

/**
 * merge class with same name to one, the differences should be in time, place, teacher, during
 * and time is the key of them/*  w  ww.j a v  a2  s . c  o m*/
 *
 * @param info another class info which has the same name with this one
 */
void combine(EnrichedClassInfo info) {
    if (info == null)
        return;
    ArraySet<ClassTime> mixedTime = new ArraySet<>();
    mixedTime.addAll(mTimeSet);

    for (ClassTime time : info.getTimeSet()) {
        boolean found = false;
        for (ClassTime myTime : mTimeSet) {
            if (myTime.equals(time)) {
                found = true;
                myTime.combineDuring(time.getDuring());
                mixedTime.add(myTime);
            }
        }
        if (!found) {
            mixedTime.add(time);
        }
    }
    mTimeSet = mixedTime;
}