package b4j.example;

import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.pc.*;

public class person_subs_0 {


public static RemoteObject  _class_globals(RemoteObject __ref) throws Exception{
 //BA.debugLineNum = 2;BA.debugLine="Sub Class_Globals";
 //BA.debugLineNum = 3;BA.debugLine="Private fx As JFX";
person._fx = RemoteObject.createNew ("anywheresoftware.b4j.objects.JFX");__ref.setField("_fx",person._fx);
 //BA.debugLineNum = 4;BA.debugLine="Private mFirstName, mLastName As String";
person._mfirstname = RemoteObject.createImmutable("");__ref.setField("_mfirstname",person._mfirstname);
person._mlastname = RemoteObject.createImmutable("");__ref.setField("_mlastname",person._mlastname);
 //BA.debugLineNum = 5;BA.debugLine="Private mBirthDate As Long";
person._mbirthdate = RemoteObject.createImmutable(0L);__ref.setField("_mbirthdate",person._mbirthdate);
 //BA.debugLineNum = 6;BA.debugLine="End Sub";
return RemoteObject.createImmutable("");
}
public static RemoteObject  _getageat(RemoteObject __ref,RemoteObject _date) throws Exception{
try {
		Debug.PushSubsStack("GetAgeAt (person) ","person",1,__ref.getField(false, "ba"),__ref,23);
if (RapidSub.canDelegate("getageat")) return __ref.runUserSub(false, "person","getageat", __ref, _date);
RemoteObject _diff = RemoteObject.createImmutable(0L);
Debug.locals.put("Date", _date);
 BA.debugLineNum = 23;BA.debugLine="Public Sub GetAgeAt(Date As Long) As Int";
Debug.ShouldStop(4194304);
 BA.debugLineNum = 24;BA.debugLine="Dim diff As Long";
Debug.ShouldStop(8388608);
_diff = RemoteObject.createImmutable(0L);Debug.locals.put("diff", _diff);
 BA.debugLineNum = 25;BA.debugLine="diff = Date - mBirthDate";
Debug.ShouldStop(16777216);
_diff = RemoteObject.solve(new RemoteObject[] {_date,__ref.getField(true,"_mbirthdate")}, "-",1, 2);Debug.locals.put("diff", _diff);
 BA.debugLineNum = 26;BA.debugLine="Return Floor(diff / DateTime.TicksPerDay / 365)";
Debug.ShouldStop(33554432);
if (true) return BA.numberCast(int.class, person.__c.runMethod(true,"Floor",(Object)(RemoteObject.solve(new RemoteObject[] {_diff,person.__c.getField(false,"DateTime").getField(true,"TicksPerDay"),RemoteObject.createImmutable(365)}, "//",0, 0))));
 BA.debugLineNum = 27;BA.debugLine="End Sub";
Debug.ShouldStop(67108864);
return RemoteObject.createImmutable(0);
}
catch (Exception e) {
			Debug.ErrorCaught(e);
			throw e;
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _getcurrentage(RemoteObject __ref) throws Exception{
try {
		Debug.PushSubsStack("GetCurrentAge (person) ","person",1,__ref.getField(false, "ba"),__ref,19);
if (RapidSub.canDelegate("getcurrentage")) return __ref.runUserSub(false, "person","getcurrentage", __ref);
 BA.debugLineNum = 19;BA.debugLine="Public Sub GetCurrentAge As Int";
Debug.ShouldStop(262144);
 BA.debugLineNum = 20;BA.debugLine="Return GetAgeAt(DateTime.Now)";
Debug.ShouldStop(524288);
if (true) return __ref.runClassMethod (b4j.example.person.class, "_getageat",(Object)(person.__c.getField(false,"DateTime").runMethod(true,"getNow")));
 BA.debugLineNum = 21;BA.debugLine="End Sub";
Debug.ShouldStop(1048576);
return RemoteObject.createImmutable(0);
}
catch (Exception e) {
			Debug.ErrorCaught(e);
			throw e;
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _getname(RemoteObject __ref) throws Exception{
try {
		Debug.PushSubsStack("GetName (person) ","person",1,__ref.getField(false, "ba"),__ref,15);
if (RapidSub.canDelegate("getname")) return __ref.runUserSub(false, "person","getname", __ref);
 BA.debugLineNum = 15;BA.debugLine="Public Sub GetName As String";
Debug.ShouldStop(16384);
 BA.debugLineNum = 16;BA.debugLine="Return mFirstName & \" \" & mLastName";
Debug.ShouldStop(32768);
if (true) return RemoteObject.concat(__ref.getField(true,"_mfirstname"),RemoteObject.createImmutable(" "),__ref.getField(true,"_mlastname"));
 BA.debugLineNum = 17;BA.debugLine="End Sub";
Debug.ShouldStop(65536);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			Debug.ErrorCaught(e);
			throw e;
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _initialize(RemoteObject __ref,RemoteObject _ba,RemoteObject _firstname,RemoteObject _lastname,RemoteObject _birthdate) throws Exception{
try {
		Debug.PushSubsStack("Initialize (person) ","person",1,__ref.getField(false, "ba"),__ref,9);
if (RapidSub.canDelegate("initialize")) return __ref.runUserSub(false, "person","initialize", __ref, _ba, _firstname, _lastname, _birthdate);
__ref.runVoidMethodAndSync("innerInitializeHelper", _ba);
Debug.locals.put("ba", _ba);
Debug.locals.put("FirstName", _firstname);
Debug.locals.put("LastName", _lastname);
Debug.locals.put("BirthDate", _birthdate);
 BA.debugLineNum = 9;BA.debugLine="Sub Initialize (FirstName As String, LastName As S";
Debug.ShouldStop(256);
 BA.debugLineNum = 10;BA.debugLine="mFirstName = FirstName";
Debug.ShouldStop(512);
__ref.setField ("_mfirstname",_firstname);
 BA.debugLineNum = 11;BA.debugLine="mLastName = LastName";
Debug.ShouldStop(1024);
__ref.setField ("_mlastname",_lastname);
 BA.debugLineNum = 12;BA.debugLine="mBirthDate = BirthDate";
Debug.ShouldStop(2048);
__ref.setField ("_mbirthdate",_birthdate);
 BA.debugLineNum = 13;BA.debugLine="End Sub";
Debug.ShouldStop(4096);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			Debug.ErrorCaught(e);
			throw e;
		} 
finally {
			Debug.PopSubsStack();
		}}
}