package eu.simuline.octave;

import java.math.BigDecimal;

/**
 * This class offers fields and methods to be accessed from within Octave 
 * to test Octave's Java interface. 
 *
 *
 * Created: Tue Jul 19 16:27:02 2016
 *
 * @author <a href="mailto:rei3ner@arcor.de">Ernst Reissner</a>
 * @version 1.0
 */
public class OctaveInterfaceTester {

    // primitive types (except void) and their wrappers 
    // names of these fields according to type names in jvm specification 

    // character types: char and Character
    public char      cVal;

    public Character cVAL;

    // logical types: boolean and Boolean 
    public boolean   zVal;

    public Boolean   zVAL;

    // floating point types: double, Double, float and Float 
    public double    dVal;

    public Double    dVAL;

    public float     fVal;

    public Float     fVAL;

    // integer types: long, Long, int, Integer, short, Short, byte and Byte

    public long      jVal;

    public Long      jVAL;

    public int       iVal;

    public Integer   iVAL;

    public short     sVal;

    public Short     sVAL;

    public byte      bVal;

    public Byte      bVAL;


    public BigDecimal bdVal;

    private int inaccessibleI;

    /**
     * Creates a new <code>OctaveInterfaceTester</code> instance.
     *
     */
    public OctaveInterfaceTester() {

    }

    private Object inaccessibleO() {
	return "return string O";
    }

    // sets dVAL 
    public void setDouble(Double num) {
	System.out.println("D");
	this.dVAL = num;
    }

    // sets dVal
    public void setDouble(double num) {
	System.out.println("d");
	this.dVal = num;
    }

    public Object throwException(int num) {
	throw new IllegalStateException("No input can be valid. ");
    }


    public static void main(String[] args) throws Exception {
	java.io.File file = new java.io.File ("/home/ernst");//("../Software");//("~/Octave");
	System.out.println(":"+file.toURI ());
	java.net.URL url = new java.net.URL("~/Octave");
	System.out.println(":"+url.toURI());
	
    }
}
