ultimatepp/examples/AndroidMath/Vector.java
klugier 2dc6459f34 .examples improved Android builder example
git-svn-id: svn://ultimatepp.org/upp/trunk@8659 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2015-07-09 20:12:31 +00:00

42 lines
719 B
Java

package org.upp.AndroidMath;
/**
* Class which whole implementaiton is native.
*/
public class Vector
{
public Vector(int size)
{
construct(size);
}
public Vector(Vector vec)
{
copyConstruct(vec);
}
@Override
protected void finalize() throws Throwable
{
destroy();
super.finalize();
}
// Native stuff - C/C++
public native int getSize();
public native float get(int id);
public native void set(int id, float value);
public native void multipleByScalar(float scalar);
public native String toString();
private native void construct(int size);
private native void copyConstruct(Vector vec);
private native void destroy();
static {
System.loadLibrary("AndroidMath");
}
}