This week, I implemented the main classes for the arrays package. I think during this process, I was able to understand the class hierarchy much better. The arrays package is pretty simple:
This is easier to understand through an example:
n = 5;
int y = new int[n];
for(int i = 0; i < n; i++)
y[i] = i;
To encode this using the arrays package in SBML, n would be a constant parameter, y would have a dimension of size n and arrayDimension would be 0 (1-D array). In the loop, we have an assignment rule where we index the ith element of y and set it to i.
In order to do this in JSBML, I created a plugin for the arrays package, which is used as a place holder for new attributes. In this case, the the attributes are list of dimensions and indices. I created a dimension object with the required fields shown on the UML diagram. Dimension extends AbstractNamedSBase because it can have id and name and implements UniqueNamedSBase to enforce that the identifier associated with the dimension object is unique. Index extends AbstractMathContainer which is a base class for everything that contains math. For both the dimension and index classes, I created getter/setter methods for each field and implemented the abstract methods.
The next step is to throughly test everything.