/** * Returns 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's ID * * @return The property's value */ public Object getProperty(final long id) { wasNull = !properties.containsKey(id); return (wasNull) ? null : properties.get(id).getValue(); }
private static String getPropertiesText(PropertySet ps) { if (ps == null) { // Not defined, oh well return ""; } StringBuilder text = new StringBuilder(); PropertyIDMap idMap = ps.getPropertySetIDMap(); Property[] props = ps.getProperties(); for (Property prop : props) { String type = Long.toString(prop.getID()); Object typeObj = (idMap == null) ? null : idMap.get(prop.getID()); if (typeObj != null) { type = typeObj.toString(); } String val = getPropertyValueText(prop.getValue()); text.append(type).append(" = ").append(val).append("\n"); } return text.toString(); }
length += VariantSupport.write(out, variantType, getValue(), codepage); return length;
b.append(getVariantName()); b.append(") "); final Object value = getValue(); b.append(", value: "); if (value instanceof String) {
final Object pValue = p.getValue(); final long pId = p.getID(); if (id != pId || (id != 0 && !typesAreEqual(type, p.getType()))) {
/** * Gets the custom properties. * * @return The custom properties. */ public CustomProperties getCustomProperties() { CustomProperties cps = null; if (getSectionCount() >= 2) { cps = new CustomProperties(); final Section section = getSections().get(1); final Map<Long,String> dictionary = section.getDictionary(); final Property[] properties = section.getProperties(); int propertyCount = 0; for (Property p : properties) { final long id = p.getID(); if (id == PropertyIDMap.PID_CODEPAGE) { cps.setCodepage((Integer)p.getValue()); } else if (id > PropertyIDMap.PID_CODEPAGE) { propertyCount++; final CustomProperty cp = new CustomProperty(p, dictionary.get(id)); cps.put(cp.getName(), cp); } } if (cps.size() != propertyCount) { cps.setPure(false); } } return cps; }
/** * Returns 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's ID * * @return The property's value */ public Object getProperty(final long id) { wasNull = !properties.containsKey(id); return (wasNull) ? null : properties.get(id).getValue(); }
/** * <p>Returns 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's ID * * @return The property's value */ public Object getProperty(final long id) { wasNull = false; for (int i = 0; i < properties.length; i++) if (id == properties[i].getID()) return properties[i].getValue(); wasNull = true; return null; }
/** * <p>Returns 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's ID * * @return The property's value */ public Object getProperty(final long id) { wasNull = false; for (int i = 0; i < properties.length; i++) if (id == properties[i].getID()) return properties[i].getValue(); wasNull = true; return null; }
private static String getPropertiesText(PropertySet ps) { if (ps == null) { // Not defined, oh well return ""; } StringBuilder text = new StringBuilder(); PropertyIDMap idMap = ps.getPropertySetIDMap(); Property[] props = ps.getProperties(); for (Property prop : props) { String type = Long.toString(prop.getID()); Object typeObj = (idMap == null) ? null : idMap.get(prop.getID()); if (typeObj != null) { type = typeObj.toString(); } String val = getPropertyValueText(prop.getValue()); text.append(type).append(" = ").append(val).append("\n"); } return text.toString(); }
final Object pValue = p.getValue(); final long pId = p.getID(); if (id != pId || (id != 0 && !typesAreEqual(type, p.getType())))
final Object pValue = p.getValue(); final long pId = p.getID(); if (id != pId || (id != 0 && !typesAreEqual(type, p.getType())))
private static String getPropertiesText(SpecialPropertySet ps) { if(ps == null) { // Not defined, oh well return ""; } StringBuffer text = new StringBuffer(); PropertyIDMap idMap = ps.getPropertySetIDMap(); Property[] props = ps.getProperties(); for(int i=0; i<props.length; i++) { String type = Long.toString( props[i].getID() ); Object typeObj = idMap.get(props[i].getID()); if(typeObj != null) { type = typeObj.toString(); } String val = getPropertyValueText( props[i].getValue() ); text.append(type + " = " + val + "\n"); } return text.toString(); } private static String getPropertyValueText(Object val) {
private static String getPropertiesText(SpecialPropertySet ps) { if(ps == null) { // Not defined, oh well return ""; } StringBuffer text = new StringBuffer(); PropertyIDMap idMap = ps.getPropertySetIDMap(); Property[] props = ps.getProperties(); for(int i=0; i<props.length; i++) { String type = Long.toString( props[i].getID() ); Object typeObj = idMap.get(props[i].getID()); if(typeObj != null) { type = typeObj.toString(); } String val = getPropertyValueText( props[i].getValue() ); text.append(type + " = " + val + "\n"); } return text.toString(); } private static String getPropertyValueText(Object val) {
length += VariantSupport.write(out, variantType, getValue(), codepage); return length;
/** * <p>Creates a <code>MutableProperty</code> as a copy of an existing * <code>Property</code>.</p> * * @param p The property to copy. */ public MutableProperty(final Property p) { setID(p.getID()); setType(p.getType()); setValue(p.getValue()); }
/** * <p>Creates a <code>MutableProperty</code> as a copy of an existing * <code>Property</code>.</p> * * @param p The property to copy. */ public MutableProperty(final Property p) { setID(p.getID()); setType(p.getType()); setValue(p.getValue()); }
if( ps.getSectionCount() != 0 ) { for( Property p : ps.getProperties() ) { System.out.println("Prop: "+p.getID()+" "+p.getValue());
/** * Gets the custom properties. * * @return The custom properties. */ public CustomProperties getCustomProperties() { CustomProperties cps = null; if (getSectionCount() >= 2) { cps = new CustomProperties(); final Section section = getSections().get(1); final Map<Long,String> dictionary = section.getDictionary(); final Property[] properties = section.getProperties(); int propertyCount = 0; for (Property p : properties) { final long id = p.getID(); if (id == PropertyIDMap.PID_CODEPAGE) { cps.setCodepage((Integer)p.getValue()); } else if (id > PropertyIDMap.PID_CODEPAGE) { propertyCount++; final CustomProperty cp = new CustomProperty(p, dictionary.get(id)); cps.put(cp.getName(), cp); } } if (cps.size() != propertyCount) { cps.setPure(false); } } return cps; }
long type = p.getType(); writeUIntToStream(out, type); VariantSupport.write(out, (int) type, p.getValue(), codepage);