-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
89d0198
commit c3c283a
Showing
8 changed files
with
293 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,78 @@ | ||
package tools.java_api; | ||
|
||
public class KuzuRelValue { | ||
|
||
long rv_ref; | ||
boolean destroyed = false; | ||
boolean isOwnedByCPP = false; | ||
|
||
private void checkNotdestroyed() { | ||
assert !destroyed: "KuzuRelValue has been destoryed."; | ||
} | ||
|
||
public KuzuRelValue(KuzuInternalID src_id, KuzuInternalID dst_id, String label) { | ||
rv_ref = KuzuNative.kuzu_rel_val_create(src_id, dst_id, label); | ||
} | ||
|
||
public KuzuRelValue clone() { | ||
checkNotdestroyed(); | ||
return KuzuNative.kuzu_rel_val_clone(this); | ||
} | ||
|
||
public void destroy() { | ||
checkNotdestroyed(); | ||
if (!isOwnedByCPP) { | ||
KuzuNative.kuzu_rel_val_destroy(this); | ||
destroyed = true; | ||
} | ||
} | ||
|
||
public KuzuValue getSrcIDVal() { | ||
checkNotdestroyed(); | ||
return KuzuNative.kuzu_rel_val_get_src_id_val(this); | ||
} | ||
|
||
public KuzuValue getDstIDVal() { | ||
checkNotdestroyed(); | ||
return KuzuNative.kuzu_rel_val_get_dst_id_val(this); | ||
} | ||
|
||
public KuzuInternalID getSrcID() { | ||
checkNotdestroyed(); | ||
return KuzuNative.kuzu_rel_val_get_src_id(this); | ||
} | ||
|
||
public KuzuInternalID getDstID() { | ||
checkNotdestroyed(); | ||
return KuzuNative.kuzu_rel_val_get_dst_id(this); | ||
} | ||
|
||
public String getLabelName() { | ||
checkNotdestroyed(); | ||
return KuzuNative.kuzu_rel_val_get_label_name(this); | ||
} | ||
|
||
public long getPropertySize() { | ||
checkNotdestroyed(); | ||
return KuzuNative.kuzu_rel_val_get_property_size(this); | ||
} | ||
|
||
public String getPropertyNameAt(long index) { | ||
checkNotdestroyed(); | ||
return KuzuNative.kuzu_rel_val_get_property_name_at(this, index); | ||
} | ||
|
||
public KuzuValue getPropertyValueAt(long index) { | ||
checkNotdestroyed(); | ||
return KuzuNative.kuzu_rel_val_get_property_value_at(this, index); | ||
} | ||
|
||
public void addProperty(String key, KuzuValue value) { | ||
checkNotdestroyed(); | ||
KuzuNative.kuzu_rel_val_add_property(this, key, value); | ||
} | ||
|
||
public String toString() { | ||
checkNotdestroyed(); | ||
return KuzuNative.kuzu_rel_val_to_string(this); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.