/** * Returns the value stored in this Node for the given keyword or null of no * value is stored for the given keyword in this node. * * @param keyword a keyword * * @return the value stored in this Node for the given keyword or null of no * value is stored for the given keyword in this node. * * @throws UnsupportedOperationException is thrown if the given keyword is * not supported by the NodeSpecification. */ public Value getValue(@NonNull final String keyword) throws UnsupportedOperationException { if (!sequence.getNodeSpecification().hasKeyword(keyword)) { throw new UnsupportedOperationException("The given keyword is not defined in the sequence!"); } return valueMap[sequence.getNodeSpecification().getKeywordIndex(keyword)]; }
/** * Sets the value for the given keyword. * * @param keyword a keyword. * @param value a value with the correct type. * * @throws UnsupportedOperationException is thrown if the given keyword is * not supported by the NodeSpecification or if the given value has the * wrong type. */ public void setValue(@NonNull final String keyword, final Value value) throws UnsupportedOperationException { if (!sequence.getNodeSpecification().hasKeyword(keyword)) { throw new UnsupportedOperationException("The given keyword is not defined in the sequence!"); } setValue(sequence.getNodeSpecification().getKeywordIndex(keyword), value); }
this.originalIndices = new int[K]; for (int k = 0; k < K; k++) { if (!nodeSpecification.hasKeyword(keywords[k])) { throw new RuntimeException("The keyword " + keywords[k] + " is not contained in the given NodeSpecification!");
this.originalIndices = new int[keywords.length]; for (int k = 0; k < keywords.length; k++) { if (!nodeSpecification.hasKeyword(keywords[k])) { throw new RuntimeException("The keyword " + keywords[k] + " is not contained in the given NodeSpecification!");