/** * Returns the editted value. * * @return the editted value. * @throws TagFormatException if the tag value cannot be retrieved with the expected type. */ public TagValue getTagValue() throws TagFormatException { try { long numer = Long.parseLong(m_numer.getText()); long denom = Long.parseLong(m_denom.getText()); Rational rational = new Rational(numer, denom); return new TagValue(m_value.getTag(), rational); } catch (NumberFormatException e) { e.printStackTrace(); throw new TagFormatException( m_numer.getText() + "/" + m_denom.getText() + " is not a valid rational"); } }
/** * Returns the editted value as a string. * * @return the editted value as a string. */ public String getAsString() { return m_numer.getText() + "/" + m_denom.getText(); }