- /**
- *
- *
- * @param vStructureState
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addStructureState(
- final jalview.schemabinding.version2.StructureState vStructureState)
- throws java.lang.IndexOutOfBoundsException {
- this._structureStateList.addElement(vStructureState);
+ /**
+ * Method getStructureState.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the jalview.schemabinding.version2.StructureState at
+ * the given index
+ */
+ public jalview.schemabinding.version2.StructureState getStructureState(
+ final int index) throws java.lang.IndexOutOfBoundsException
+ {
+ // check bounds for index
+ if (index < 0 || index >= this._structureStateList.size())
+ {
+ throw new IndexOutOfBoundsException(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
+ "getStructureState",
+ Integer.valueOf(index).toString(),
+ Integer.valueOf((this._structureStateList.size() - 1)).toString()
+ }));