/** * Checks whether this {@link PropertySet} represents a Summary Information. * * @return {@code true} if this {@link PropertySet} * represents a Summary Information, else {@code false}. */ public boolean isSummaryInformation() { return !sections.isEmpty() && matchesSummary(getFirstSection().getFormatID(), SummaryInformation.FORMAT_ID); }
/** * Checks whether this {@link PropertySet} is a Document Summary Information. * * @return {@code true} if this {@link PropertySet} * represents a Document Summary Information, else {@code false}. */ public boolean isDocumentSummaryInformation() { return !sections.isEmpty() && matchesSummary(getFirstSection().getFormatID(), DocumentSummaryInformation.FORMAT_ID); }
public String toString(PropertyIDMap idMap) { final StringBuilder b = new StringBuilder(); final Property[] pa = getProperties(); b.append("\n\n\n"); b.append(getClass().getName()); b.append('['); b.append("formatID: "); b.append(getFormatID()); b.append(", offset: "); b.append(getOffset()); b.append(", propertyCount: "); b.append(getPropertyCount()); b.append(", size: "); b.append(getSize()); b.append(", properties: [\n"); int codepage = getCodepage(); if (codepage == -1) { codepage = Property.DEFAULT_CODEPAGE; } for (Property p : pa) { b.append(p.toString(codepage, idMap)); b.append(",\n"); } b.append(']'); b.append(']'); return b.toString(); }
if (!s.getFormatID().equals(getFormatID())) { return false;
/** * @see Object#hashCode() */ @Override public int hashCode() { long hashCode = 0; hashCode += getFormatID().hashCode(); final Property[] pa = getProperties(); for (Property aPa : pa) { hashCode += aPa.hashCode(); } return (int) (hashCode & 0x0ffffffffL); }
/** * Sets the section's format ID. * * @param formatID The section's format ID as a byte array. It components * are in big-endian format. */ @SuppressWarnings("WeakerAccess") public void setFormatID(final byte[] formatID) { ClassID fid = getFormatID(); if (fid == null) { fid = new ClassID(); setFormatID(fid); } fid.setBytes(formatID); }
/** * Constructs a {@code Section} by doing a deep copy of an * existing {@code Section}. All nested {@code Property} * instances, will be their mutable counterparts in the new * {@code MutableSection}. * * @param s The section set to copy */ public Section(final Section s) { this._offset = -1; setFormatID(s.getFormatID()); for (Property p : s.properties.values()) { properties.put(p.getID(), new Property(p)); } setDictionary(s.getDictionary()); }
/** * Returns the PID string associated with a property ID. The ID * is first looked up in the {@link Section Sections} private dictionary. * If it is not found there, the property PID string is taken * from sections format IDs namespace. * If the PID is also undefined there, i.e. it is not well-known, * {@code "[undefined]"} is returned. * * @param pid The property ID * * @return The well-known property ID string associated with the * property ID {@code pid} */ public String getPIDString(final long pid) { Map<Long,String> dic = getDictionary(); if (dic == null || !dic.containsKey(pid)) { ClassID fmt = getFormatID(); if (SummaryInformation.FORMAT_ID.equals(fmt)) { dic = PropertyIDMap.getSummaryInformationProperties(); } else if (DocumentSummaryInformation.FORMAT_ID[0].equals(fmt)) { dic = PropertyIDMap.getDocumentSummaryInformationProperties(); } } return (dic != null && dic.containsKey(pid)) ? dic.get(pid) : PropertyIDMap.UNDEFINED; }
final ClassID formatID = section.getFormatID(); if (formatID == null) { throw new NoFormatIDException();
/** * Checks whether this {@link PropertySet} represents a Summary Information. * * @return {@code true} if this {@link PropertySet} * represents a Summary Information, else {@code false}. */ public boolean isSummaryInformation() { return !sections.isEmpty() && matchesSummary(getFirstSection().getFormatID(), SummaryInformation.FORMAT_ID); }
/** * Checks whether this {@link PropertySet} is a Document Summary Information. * * @return {@code true} if this {@link PropertySet} * represents a Document Summary Information, else {@code false}. */ public boolean isDocumentSummaryInformation() { return !sections.isEmpty() && matchesSummary(getFirstSection().getFormatID(), DocumentSummaryInformation.FORMAT_ID); }
/** * <p>Checks whether this {@link PropertySet} is a Document * Summary Information.</p> * * @return <code>true</code> if this {@link PropertySet} * represents a Document Summary Information, else <code>false</code>. */ public boolean isDocumentSummaryInformation() { if (sections.size() <= 0) return false; return Util.equal(sections.get(0).getFormatID().getBytes(), SectionIDMap.DOCUMENT_SUMMARY_INFORMATION_ID[0]); }
/** * <p>Checks whether this {@link PropertySet} represents a Summary * Information.</p> * * @return <code>true</code> if this {@link PropertySet} * represents a Summary Information, else <code>false</code>. */ public boolean isSummaryInformation() { if (sections.size() <= 0) return false; return Util.equal(sections.get(0).getFormatID().getBytes(), SectionIDMap.SUMMARY_INFORMATION_ID); }
/** * <p>Checks whether this {@link PropertySet} represents a Summary * Information.</p> * * @return <code>true</code> if this {@link PropertySet} * represents a Summary Information, else <code>false</code>. */ public boolean isSummaryInformation() { if (sections.size() <= 0) return false; return Util.equal(sections.get(0).getFormatID().getBytes(), SectionIDMap.SUMMARY_INFORMATION_ID); }
/** * <p>Checks whether this {@link PropertySet} is a Document * Summary Information.</p> * * @return <code>true</code> if this {@link PropertySet} * represents a Document Summary Information, else <code>false</code>. */ public boolean isDocumentSummaryInformation() { if (sections.size() <= 0) return false; return Util.equal(sections.get(0).getFormatID().getBytes(), SectionIDMap.DOCUMENT_SUMMARY_INFORMATION_ID[0]); }
/** * @see Object#hashCode() */ public int hashCode() { long hashCode = 0; hashCode += getFormatID().hashCode(); final Property[] pa = getProperties(); for (int i = 0; i < pa.length; i++) hashCode += pa[i].hashCode(); final int returnHashCode = (int) (hashCode & 0x0ffffffffL); return returnHashCode; }
/** * @see Object#hashCode() */ public int hashCode() { long hashCode = 0; hashCode += getFormatID().hashCode(); final Property[] pa = getProperties(); for (int i = 0; i < pa.length; i++) hashCode += pa[i].hashCode(); final int returnHashCode = (int) (hashCode & 0x0ffffffffL); return returnHashCode; }
/** * @see Object#hashCode() */ @Override public int hashCode() { long hashCode = 0; hashCode += getFormatID().hashCode(); final Property[] pa = getProperties(); for (Property aPa : pa) { hashCode += aPa.hashCode(); } return (int) (hashCode & 0x0ffffffffL); }
/** * Sets the section's format ID. * * @param formatID The section's format ID as a byte array. It components * are in big-endian format. */ @SuppressWarnings("WeakerAccess") public void setFormatID(final byte[] formatID) { ClassID fid = getFormatID(); if (fid == null) { fid = new ClassID(); setFormatID(fid); } fid.setBytes(formatID); }
/** * Constructs a {@code Section} by doing a deep copy of an * existing {@code Section}. All nested {@code Property} * instances, will be their mutable counterparts in the new * {@code MutableSection}. * * @param s The section set to copy */ public Section(final Section s) { this._offset = -1; setFormatID(s.getFormatID()); for (Property p : s.properties.values()) { properties.put(p.getID(), new Property(p)); } setDictionary(s.getDictionary()); }