Creating Ordered Complex Datatypes
From AIBenchWiki
It is now possible to define a relative order inside COMPLEX Datatypes.
This allows for the correct ordering of subitems inside Datatypes. When serialization/marshalling operations occur, it is usual for AIBench to lose the original positioning of the elements inside the JTree. This extends the COMPLEX Datatypes with a persistent relative ordering for the subitems of a given Datatype.
To do it one must do the following:
- The @Clipboard annotation (inside COMPLEX Datatypes) now has a method called order(), by defining it, you will be defining the relative order of that element inside the Datatype.
@Clipboard(name="Name",order=1){
public String getName(){
return this.name;
}
- The order is interpreted as a magnitude order, so you can define several elements with gaps, just as follows:
@Clipboard(name="x",order=1) ... @Clipboard(name="y",order=10) ... @Clipboard(name="z",order=100)
- The user must not repeat orders within Datatypes. AIBench will throw an IllegalArgumentException if that happens:
@Clipboard(name="x",order=1) ... @Clipboard(name="y",order=1) ... @Clipboard(name="z",order=10)
- The user is responsible to guarantee that all the @Clipboard annotated methods inside a COMPLEX Datatype are correctly ordered.
Meaning that, if one defines an order for a method inside a Datatype, but doesn't define the order for the other methods inside that same Datatype, the behavior will probably be incoherent.
- If one does not define any order for all the @Clipboard annotated methods inside a COMPLEX Datatype, the behavior will be the traditional one, meaning that the ordering is fully OPTIONAL.

