Userlib Packages
Classes in the userlib package and userlib.abi package is optionally packaged along-side your contract code as common-case utilities and quality of life routines.
Classes in the userlib package and userlib.abi package are optionally packaged along-side your contract code as common-case utilities and quality of life routines.
AionBuffer
The Aion specific implementation of the Java Buffer interface. Allows the easy encoding/decoding of primitive values. Take a look at the AVM API page for AionBuffer.
AionList
The Aion specific implementation of the Java List interface. A list is an object that contains one or more of the same type of element. You cannon have a list that contains both String
and int
elements.
Take a look at the AVM API page for AionList.
Create an AionList Object
Add an Element to an AionList
Remove a Single Element from an AionList
Remove all Elements from an AionList
Check an Element Exists in an AionList
Get the Size of an AionList
Add all Elements in a Collection to an AionList
Check if an AionList contains all the Elements of another Collection
Check if an AionList is Empty
Remove all Elements from an AionList not within another Object
AionMap
The Aion specific implementation of the Java Map interface. An object that maps keys to values. A map cannot contain duplicate keys. Each key is mapped to only one value.
Take a look at the AVM API page for AionMap.
Create a Map
Add an Element into a Map
Get a Single Element from a Map
To send an element from within a map array to another part of the Java contract, supply the element’s id
to the map array:
To return an entire element from within a map array to somewhere outside the Java contract, you need to specify each attribute of the element.
Get All Elements from a Map
To send all the element from within a map array to another part of the Java contract, simply request the whole array:
To return the entire map array to somewhere outside the Java contract, you need to loop through the array and parse everything into a String
or another type:
AionSet
The Aion specific implementation of the Java Set interface. A set is a collection of elements with absolutely no duplicate elements. Each element in the set is completely unique.
Take a look at the AVM API page for AionSet.