@Override public Datatype<?> getPrimitiveDatatype() { return OWLReal.getInstance(); }
@Override public ATermAppl getCanonicalRepresentation(final ATermAppl input) throws InvalidLiteralException { final String lexicalForm = getLexicalForm(input); throw new InvalidLiteralException(getName(), lexicalForm); }
@Override public ATermAppl getCanonicalRepresentation(final ATermAppl input) throws InvalidLiteralException { final Number n = getValue(input); if (n instanceof Rational) { final String canonicalForm = Rational.simplify((Rational) n).toString(); if (canonicalForm.equals(ATermUtils.getLiteralValue(input))) return input; else return ATermUtils.makeTypedLiteral(canonicalForm, getName()); } else return OWLReal.getInstance().getLiteral(OWLRealUtils.getCanonicalObject(n)); }
@Override public ATermAppl getCanonicalRepresentation(final ATermAppl input) throws InvalidLiteralException { final Number n = getValue(input); if (n instanceof Rational) { final String canonicalForm = Rational.simplify((Rational) n).toString(); if (canonicalForm.equals(ATermUtils.getLiteralValue(input))) return input; else return ATermUtils.makeTypedLiteral(canonicalForm, getName()); } else return OWLReal.getInstance().getLiteral(OWLRealUtils.getCanonicalObject(n)); }
@Override public Number getValue(final ATermAppl literal) throws InvalidLiteralException { final String lexicalForm = getLexicalForm(literal); throw new InvalidLiteralException(getName(), lexicalForm); }
@Override public Datatype<?> getPrimitiveDatatype() { return OWLReal.getInstance(); }
@Override public Number getValue(final ATermAppl literal) throws InvalidLiteralException { final String lexicalForm = getLexicalForm(literal); throw new InvalidLiteralException(getName(), lexicalForm); }
@Override public ATermAppl getCanonicalRepresentation(final ATermAppl input) throws InvalidLiteralException { final String lexicalForm = getLexicalForm(input); throw new InvalidLiteralException(getName(), lexicalForm); }