corda/classpath/avian/Android.java
Joel Dice d414fd4c7b more progress on Android class library port
Hello.java works.  Yay.
2013-02-20 10:22:40 -07:00

31 lines
845 B
Java

/* Copyright (c) 2013, Avian Contributors
Permission to use, copy, modify, and/or distribute this software
for any purpose with or without fee is hereby granted, provided
that the above copyright notice and this permission notice appear
in all copies.
There is NO WARRANTY for this software. See license.txt for
details. */
package avian;
public class Android {
public static VMField findField(VMClass vmClass, String name) {
if (vmClass.fieldTable != null) {
Classes.link(vmClass);
for (int i = 0; i < vmClass.fieldTable.length; ++i) {
if (getName(vmClass.fieldTable[i]).equals(name)) {
return vmClass.fieldTable[i];
}
}
}
return null;
}
public static String getName(VMField vmField) {
return new String(vmField.name, 0, vmField.name.length - 1);
}
}