/** * Returns the specification for the given keyword. * * @param keyword a keyword. * * @return the specification for the given keyword. */ public KeywordSpecification getKeywordSpecification(@NonNull final String keyword) { return getKeywordSpecification(getKeywordIndex(keyword)); }
/** * 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); }
+ " has the wrong type!"); this.originalIndices[k] = nodeSpecification.getKeywordIndex(keywords[k]);
+ " has the wrong type!"); this.originalIndices[k] = nodeSpecification.getKeywordIndex(keywords[k]);