mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-21 09:02:50 -06:00
just for fun: hashCode for expressions
This commit is contained in:
@@ -1388,6 +1388,13 @@ Java_org_grammaticalframework_pgf_Expr_equals(JNIEnv* env, jobject self, jobject
|
|||||||
return JNI_FALSE;
|
return JNI_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JNIEXPORT jint JNICALL
|
||||||
|
Java_org_grammaticalframework_pgf_Expr_hashCode(JNIEnv* env, jobject self)
|
||||||
|
{
|
||||||
|
PgfExpr e = gu_variant_from_ptr(l2p(get_ref(env, self)));
|
||||||
|
return pgf_expr_hash(0, e);
|
||||||
|
}
|
||||||
|
|
||||||
JNIEXPORT jstring JNICALL
|
JNIEXPORT jstring JNICALL
|
||||||
Java_org_grammaticalframework_pgf_Type_getCategory(JNIEnv* env, jobject self)
|
Java_org_grammaticalframework_pgf_Type_getCategory(JNIEnv* env, jobject self)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -102,6 +102,8 @@ public class Expr implements Serializable {
|
|||||||
* @return True if the expressions are equal. */
|
* @return True if the expressions are equal. */
|
||||||
public native boolean equals(Expr e);
|
public native boolean equals(Expr e);
|
||||||
|
|
||||||
|
public native int hashCode();
|
||||||
|
|
||||||
private static native String showExpr(long ref);
|
private static native String showExpr(long ref);
|
||||||
|
|
||||||
private static native long initStringLit(String s, long pool);
|
private static native long initStringLit(String s, long pool);
|
||||||
|
|||||||
Reference in New Issue
Block a user