Java tutorial
//package com.java2s; /******************************************************************************* * Copyright (c) 2006, 2012, 2011 IBM Corporation, Zeligsoft Inc., and others. * 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: * IBM - Initial API and implementation * Zeligsoft - Bugs 244946, 248869 * Axel Uhl (SAP AG) - Bug 342644 *******************************************************************************/ import java.util.Collection; public class Main { /** * Implementation of the OCL * <tt>Collection::notEmpty() : Boolean</tt> * operation. * * @param self the source collection * @return whether the collection has any elements */ public static boolean notEmpty(Collection<?> self) { return !self.isEmpty(); } /** * Implementation of the OCL * <tt>Collection::isEmpty() : Boolean</tt> * operation. * * @param self the source collection * @return whether the collection does not have any elements */ public static boolean isEmpty(Collection<?> self) { return self.isEmpty(); } }