Example #1
0
 /**
  * Gets group supporting the given QTI class name.
  *
  * @param qtiClassName name of requested group
  * @return group with given name
  * @throws QtiNodeGroupException if group is not found
  */
 public NodeGroup<?, ?> getGroupSupporting(final String qtiClassName) {
   for (final NodeGroup<?, ?> child : groups) {
     if (child.supportsQtiClass(qtiClassName)) {
       return child;
     }
   }
   throw new QtiNodeGroupException("Cannot find node group supporting " + qtiClassName);
 }
Example #2
0
 /**
  * Gets group with given name.
  *
  * @param name name of requested group
  * @return group with given name
  * @throws QtiNodeGroupException if group is not found
  */
 public NodeGroup<?, ?> get(final String name) {
   for (final NodeGroup<?, ?> child : groups) {
     if (child.getName().equals(name) || child.supportsQtiClass(name)) {
       return child;
     }
   }
   throw new QtiNodeGroupException("Cannot find node group with name " + name);
 }