// SortDemo.java

     /****************************************************************
      * Copyright (C) 1996 - 2000 Micro Focus International Ltd.     *
      * All Rights Reserved.                                         *
      ****************************************************************
      * The program demonstrates the use of Java invoking Object     *
      * COBOL and vice versa using Java objects as parameters.       *
      *                                                              *
      * This class is the equivalent Java class to the COBOL class   *
      * "SortDemo" and invokes the COBOL methods in the latter.      *
      * It inherits from com.microfocus.cobol.RuntimeObject, a       *
      * class in the com.microfocus.cobol package,                   *
      * which implements the cobinvoke_* methods.                    *
      *                                                              *
      * cobloadclass should always be called in the static           *
      * initializer of the Java class.                               *
      *                                                              *
      * REQUIREMENTS: Sun JDK 1.2.2 (or later) must be installed.    *
      *                                                              *
      * $(#) V1.0                                                    *
      ****************************************************************/

import java.util.Vector;
import com.microfocus.cobol.*;

public class SortDemo extends com.microfocus.cobol.RuntimeObject {

	static String javaClassName = "SortDemo";
	static
	{
		/* Load the class */
		cobloadclass ("sortdemo", "SortDemo", javaClassName);
	}

	public Vector mergeVectors(Vector v1, Vector v2, Compare c) throws Exception, CobolException
	{
		Object params[] = {v1, v2, c};
		return ((Vector) cobinvoke_object("mergeVectors", params));
	}

	public Vector sortVector(Vector v, Compare c) throws Exception, CobolException
	{
		Object params[] = {v, c};
		return ((Vector) cobinvoke_object("sortVector", params));
	}
}
