Java Calendar Compare min(final Calendar... calendars)

Here you can find the source of min(final Calendar... calendars)

Description

min

License

Open Source License

Declaration

public static Calendar min(final Calendar... calendars) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2009 Lifeform Software.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:/*from  ww w .j  ava 2  s  .  co m*/
 *     Ernan Hughes - initial API and implementation
 *******************************************************************************/

import java.util.Arrays;
import java.util.Calendar;
import java.util.Collections;

import java.util.Vector;

public class Main {
    public static Calendar min(final Calendar... calendars) {
        Vector<Calendar> list = new Vector<Calendar>(
                Arrays.asList(calendars));
        Collections.sort(list);
        return list.firstElement();
    }
}

Related

  1. isSameInstant(Calendar cal1, Calendar cal2)
  2. isSameInstant(Calendar cal1, Calendar cal2)
  3. isSameInstant(final Calendar cal1, final Calendar cal2)
  4. max(Calendar cal1, Calendar cal2)
  5. min(Calendar c1, Calendar c2)
  6. minCalendars(List calendars)
  7. minimum(Calendar... calendars)