Sha256: 190bad7533fe5a947494b262df3983ee1176f701209049dc646c1acf040506e7

Contents?: true

Size: 1.84 KB

Versions: 14

Compression:

Stored size: 1.84 KB

Contents

package com.rho.rhoelements.activex;

import com.rho.rhoelements.apd.ApdEngine;

public class APD extends ActiveX
{
	static private APD myInstance = new APD();
	static private ApdEngine myApdEngine = new ApdEngine();

	private APD()
	{
	};

	static public synchronized APD getInstance()
	{
		// decide here if this class should be a singleton
		return myInstance;
	}

	@Override
	protected Object clone() throws CloneNotSupportedException
	{
		throw new CloneNotSupportedException("Clone is not allowed.");
	}

	//args[0 ] - int command, args[1] - String params
	public String[] psexternal(String[] args) throws Exception
	{
		if (args.length != 2)
		{
			// TODO: change to return/error code since this has to go through NPAPI back to user
			throw new Exception("Invalid number of parameters to APD.psexternal. Expecting 2,  recieved " + args.length);
		}
		myApdEngine.PSExternal(Integer.parseInt(args[0]), args[1]);
		return null;
	}

	//args[0 ] - int command, args[1] - String params
	public String[] psexternalex(String[] args) throws Exception
	{
		if (args.length != 2)
		{
			// TODO: change to return/error code since this has to go through NPAPI back to user
			throw new Exception("Invalid number of parameters to APD.psexternal. Expecting 2,  recieved " + args.length);
		}
		Integer temp = new Integer(myApdEngine.PSExternalEx(Integer.parseInt(args[0]), args[1]));

		String[] result = new String[1];
		result[0] = temp.toString();

		return result;
	}

	//no args
	public String[] psgetlastmessage(String[] args) throws Exception
	{
		if (args.length != 0)
		{
			// TODO: change to return/error code since this has to go through NPAPI back to user
			throw new Exception("Invalid number of parameters to APD.psexternal. Expecting 0,  recieved " + args.length);
		}

		String[] result = new String[1];
		result[0] = myApdEngine.PSGetLastMessage();

		return result;
	}
}

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rhodes-7.6.0 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/activex/APD.java
rhodes-7.5.1 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/activex/APD.java
rhodes-7.4.1 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/activex/APD.java
rhodes-7.1.17 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/activex/APD.java
rhodes-6.2.0 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/activex/APD.java
rhodes-6.0.11 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/activex/APD.java
rhodes-5.5.18 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/activex/APD.java
rhodes-5.5.17 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/activex/APD.java
rhodes-5.5.15 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/activex/APD.java
rhodes-5.5.0.22 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/activex/APD.java
rhodes-5.5.2 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/activex/APD.java
rhodes-5.5.0.7 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/activex/APD.java
rhodes-5.5.0.3 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/activex/APD.java
rhodes-5.5.0 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/activex/APD.java