/** * Returns the value of the boolean property with the specified * ID. If the property is not available, {@code false} is * returned. A subsequent call to {@link #wasNull} will return * {@code true} to let the caller distinguish that case from * a real property value of {@code false}. * * @param id The property's ID * * @return The property's value */ boolean getPropertyBooleanValue(final int id) { final Boolean b = (Boolean) getProperty(id); return b != null && b; }
/** * Gets the section's dictionary. A dictionary allows an application to * use human-readable property names instead of numeric property IDs. It * contains mappings from property IDs to their associated string * values. The dictionary is stored as the property with ID 0. The codepage * for the strings in the dictionary is defined by property with ID 1. * * @return the dictionary or {@code null} if the section does not have * a dictionary. */ @SuppressWarnings("unchecked") public Map<Long,String> getDictionary() { if (dictionary == null) { dictionary = (Map<Long,String>) getProperty(PropertyIDMap.PID_DICTIONARY); } return dictionary; }
/** * Gets the section's codepage, if any. * * @return The section's codepage if one is defined, else -1. */ public int getCodepage() { final Integer codepage = (Integer) getProperty(PropertyIDMap.PID_CODEPAGE); return (codepage == null) ? -1 : codepage.intValue(); }
/** * Convenience method returning the value of the property with the specified ID. * If the property is not available, {@code null} is returned and a subsequent * call to {@link #wasNull} will return {@code true}. * * @param id The property ID * @return The property value * @throws NoSingleSectionException if the {@link PropertySet} has * more or less than one {@link Section}. */ protected Object getProperty(final int id) throws NoSingleSectionException { return getFirstSection().getProperty(id); }
/** * Returns the value of the numeric property with the specified * ID. If the property is not available, 0 is returned. A * subsequent call to {@link #wasNull} will return * {@code true} to let the caller distinguish that case from * a real property value of 0. * * @param id The property's ID * * @return The property's value */ int getPropertyIntValue(final long id) { final Number i; final Object o = getProperty(id); if (o == null) { return 0; } if (!(o instanceof Long || o instanceof Integer)) { throw new HPSFRuntimeException ("This property is not an integer type, but " + o.getClass().getName() + "."); } i = (Number) o; return i.intValue(); }
/** * Returns the value of the boolean property with the specified * ID. If the property is not available, {@code false} is * returned. A subsequent call to {@link #wasNull} will return * {@code true} to let the caller distinguish that case from * a real property value of {@code false}. * * @param id The property's ID * * @return The property's value */ boolean getPropertyBooleanValue(final int id) { final Boolean b = (Boolean) getProperty(id); return b != null && b; }
/** * Gets the section's dictionary. A dictionary allows an application to * use human-readable property names instead of numeric property IDs. It * contains mappings from property IDs to their associated string * values. The dictionary is stored as the property with ID 0. The codepage * for the strings in the dictionary is defined by property with ID 1. * * @return the dictionary or {@code null} if the section does not have * a dictionary. */ @SuppressWarnings("unchecked") public Map<Long,String> getDictionary() { if (dictionary == null) { dictionary = (Map<Long,String>) getProperty(PropertyIDMap.PID_DICTIONARY); } return dictionary; }
/** * Gets the section's codepage, if any. * * @return The section's codepage if one is defined, else -1. */ public int getCodepage() { final Integer codepage = (Integer) getProperty(PropertyIDMap.PID_CODEPAGE); return (codepage == null) ? -1 : codepage.intValue(); }
/** * <p>Gets the section's codepage, if any.</p> * * @return The section's codepage if one is defined, else -1. */ public int getCodepage() { final Integer codepage = (Integer) getProperty(PropertyIDMap.PID_CODEPAGE); if (codepage == null) return -1; int cp = codepage.intValue(); return cp; }
/** * <p>Gets the section's codepage, if any.</p> * * @return The section's codepage if one is defined, else -1. */ public int getCodepage() { final Integer codepage = (Integer) getProperty(PropertyIDMap.PID_CODEPAGE); if (codepage == null) return -1; int cp = codepage.intValue(); return cp; }
/** * <p>Returns the value of the boolean property with the specified * ID. If the property is not available, <code>false</code> is * returned. A subsequent call to {@link #wasNull} will return * <code>true</code> to let the caller distinguish that case from * a real property value of <code>false</code>.</p> * * @param id The property's ID * * @return The property's value */ protected boolean getPropertyBooleanValue(final int id) { final Boolean b = (Boolean) getProperty(id); if (b == null) { return false; } return b.booleanValue(); }
/** * <p>Returns the value of the boolean property with the specified * ID. If the property is not available, <code>false</code> is * returned. A subsequent call to {@link #wasNull} will return * <code>true</code> to let the caller distinguish that case from * a real property value of <code>false</code>.</p> * * @param id The property's ID * * @return The property's value */ protected boolean getPropertyBooleanValue(final int id) { final Boolean b = (Boolean) getProperty(id); if (b == null) { return false; } return b.booleanValue(); }
/** * Convenience method returning the value of the property with the specified ID. * If the property is not available, {@code null} is returned and a subsequent * call to {@link #wasNull} will return {@code true}. * * @param id The property ID * @return The property value * @throws NoSingleSectionException if the {@link PropertySet} has * more or less than one {@link Section}. */ protected Object getProperty(final int id) throws NoSingleSectionException { return getFirstSection().getProperty(id); }
/** * <p>Gets a property.</p> * * @param id The ID of the property to get * @return The property or <code>null</code> if there is no such property */ public Object getProperty(final long id) { /* Calling getProperties() ensures that properties and preprops are in * sync.</p> */ getProperties(); return super.getProperty(id); }
/** * <p>Gets a property.</p> * * @param id The ID of the property to get * @return The property or <code>null</code> if there is no such property */ public Object getProperty(final long id) { /* Calling getProperties() ensures that properties and preprops are in * sync.</p> */ getProperties(); return super.getProperty(id); }
/** * <p>Convenience method returning the value of the property with * the specified ID. If the property is not available, * <code>null</code> is returned and a subsequent call to {@link * #wasNull} will return <code>true</code> .</p> * * @param id The property ID * @return The property value * @throws NoSingleSectionException if the {@link PropertySet} has * more or less than one {@link Section}. */ protected Object getProperty(final int id) throws NoSingleSectionException { return getFirstSection().getProperty(id); }
/** * <p>Convenience method returning the value of the property with * the specified ID. If the property is not available, * <code>null</code> is returned and a subsequent call to {@link * #wasNull} will return <code>true</code> .</p> * * @param id The property ID * @return The property value * @throws NoSingleSectionException if the {@link PropertySet} has * more or less than one {@link Section}. */ protected Object getProperty(final int id) throws NoSingleSectionException { return getFirstSection().getProperty(id); }
/** * <p>Returns the value of the numeric property with the specified * ID. If the property is not available, 0 is returned. A * subsequent call to {@link #wasNull} will return * <code>true</code> to let the caller distinguish that case from * a real property value of 0.</p> * * @param id The property's ID * * @return The property's value */ protected int getPropertyIntValue(final long id) { final Number i; final Object o = getProperty(id); if (o == null) return 0; if (!(o instanceof Long || o instanceof Integer)) throw new HPSFRuntimeException ("This property is not an integer type, but " + o.getClass().getName() + "."); i = (Number) o; return i.intValue(); }
/** * Returns the value of the numeric property with the specified * ID. If the property is not available, 0 is returned. A * subsequent call to {@link #wasNull} will return * {@code true} to let the caller distinguish that case from * a real property value of 0. * * @param id The property's ID * * @return The property's value */ int getPropertyIntValue(final long id) { final Number i; final Object o = getProperty(id); if (o == null) { return 0; } if (!(o instanceof Long || o instanceof Integer)) { throw new HPSFRuntimeException ("This property is not an integer type, but " + o.getClass().getName() + "."); } i = (Number) o; return i.intValue(); }
/** * <p>Returns the value of the numeric property with the specified * ID. If the property is not available, 0 is returned. A * subsequent call to {@link #wasNull} will return * <code>true</code> to let the caller distinguish that case from * a real property value of 0.</p> * * @param id The property's ID * * @return The property's value */ protected int getPropertyIntValue(final long id) { final Number i; final Object o = getProperty(id); if (o == null) return 0; if (!(o instanceof Long || o instanceof Integer)) throw new HPSFRuntimeException ("This property is not an integer type, but " + o.getClass().getName() + "."); i = (Number) o; return i.intValue(); }