/** * Returns the String-value of a <tt>Value</tt> object. This returns either * a {@link org.openrdf.model.Literal}'s label, a {@link org.openrdf.model.URI}'s URI or a {@link org.openrdf.model.BNode}'s ID. */ @Override public String stringValue() { return getLabel(); } }
/** * Returns the String-value of a <tt>Value</tt> object. This returns either * a {@link org.openrdf.model.Literal}'s label, a {@link org.openrdf.model.URI}'s URI or a {@link org.openrdf.model.BNode}'s ID. */ @Override public String stringValue() { return getLabel(); } }
/** * Returns the <tt>boolean</tt> value of this literal. * * @return The <tt>long</tt> value of the literal. * @throws IllegalArgumentException If the literal's label cannot be represented by a <tt>boolean</tt>. */ @Override public boolean booleanValue() { return Boolean.parseBoolean(getLabel()); }
/** * Returns the <tt>byte</tt> value of this literal. * * @return The <tt>byte value of the literal. * @throws NumberFormatException If the literal cannot be represented by a <tt>byte</tt>. */ @Override public byte byteValue() { return Byte.parseByte(getLabel()); }
/** * Returns the <tt>short</tt> value of this literal. * * @return The <tt>short</tt> value of the literal. * @throws NumberFormatException If the literal's label cannot be represented by a <tt>short</tt>. */ @Override public short shortValue() { return Short.parseShort(getLabel()); }
/** * Returns the <tt>boolean</tt> value of this literal. * * @return The <tt>long</tt> value of the literal. * @throws IllegalArgumentException If the literal's label cannot be represented by a <tt>boolean</tt>. */ @Override public boolean booleanValue() { return Boolean.parseBoolean(getLabel()); }
/** * Returns the <tt>byte</tt> value of this literal. * * @return The <tt>byte value of the literal. * @throws NumberFormatException If the literal cannot be represented by a <tt>byte</tt>. */ @Override public byte byteValue() { return Byte.parseByte(getLabel()); }
/** * Returns the <tt>long</tt> value of this literal. * * @return The <tt>long</tt> value of the literal. * @throws NumberFormatException If the literal's label cannot be represented by to a <tt>long</tt>. */ @Override public long longValue() { return Long.parseLong(getLabel()); }
/** * Returns the integer value of this literal. * * @return The integer value of the literal. * @throws NumberFormatException If the literal's label is not a valid integer. */ @Override public BigInteger integerValue() { return new BigInteger(getLabel()); }
/** * Returns the <tt>double</tt> value of this literal. * * @return The <tt>double</tt> value of the literal. * @throws NumberFormatException If the literal's label cannot be represented by a <tt>double</tt>. */ @Override public double doubleValue() { return Double.parseDouble(getLabel()); }
/** * Returns the <tt>long</tt> value of this literal. * * @return The <tt>long</tt> value of the literal. * @throws NumberFormatException If the literal's label cannot be represented by to a <tt>long</tt>. */ @Override public long longValue() { return Long.parseLong(getLabel()); }
/** * Returns the decimal value of this literal. * * @return The decimal value of the literal. * @throws NumberFormatException If the literal's label is not a valid decimal. */ @Override public BigDecimal decimalValue() { return new BigDecimal(getLabel()); }
/** * Returns the <tt>float</tt> value of this literal. * * @return The <tt>float</tt> value of the literal. * @throws NumberFormatException If the literal's label cannot be represented by a <tt>float</tt>. */ @Override public float floatValue() { return Float.parseFloat(getLabel()); }
/** * Returns the <tt>short</tt> value of this literal. * * @return The <tt>short</tt> value of the literal. * @throws NumberFormatException If the literal's label cannot be represented by a <tt>short</tt>. */ @Override public short shortValue() { return Short.parseShort(getLabel()); }
/** * Returns the integer value of this literal. * * @return The integer value of the literal. * @throws NumberFormatException If the literal's label is not a valid integer. */ @Override public BigInteger integerValue() { return new BigInteger(getLabel()); }
/** * Returns the <tt>int</tt> value of this literal. * * @return The <tt>int</tt> value of the literal. * @throws NumberFormatException If the literal's label cannot be represented by a <tt>int</tt>. */ @Override public int intValue() { return Integer.parseInt(getLabel()); }
/** * Returns the <tt>double</tt> value of this literal. * * @return The <tt>double</tt> value of the literal. * @throws NumberFormatException If the literal's label cannot be represented by a <tt>double</tt>. */ @Override public double doubleValue() { return Double.parseDouble(getLabel()); }
@Override public int hashCode() { // not compatible with Sesame: /* int result = this.getClass().hashCode(); result = 31 * result + (locale != null ? locale.hashCode() : 0); result = 31 * result + (type != null ? type.hashCode() : 0); result = 31 * result + this.getLabel().hashCode(); return result; */ return getLabel().hashCode(); }
/** * Returns the <tt>int</tt> value of this literal. * * @return The <tt>int</tt> value of the literal. * @throws NumberFormatException If the literal's label cannot be represented by a <tt>int</tt>. */ @Override public int intValue() { return Integer.parseInt(getLabel()); }
/** * Returns the <tt>float</tt> value of this literal. * * @return The <tt>float</tt> value of the literal. * @throws NumberFormatException If the literal's label cannot be represented by a <tt>float</tt>. */ @Override public float floatValue() { return Float.parseFloat(getLabel()); }