📄 documentsummaryinformation.java
字号:
/* ==================================================================== Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.==================================================================== */ package org.apache.poi.hpsf;import java.util.Iterator;import java.util.Map;import org.apache.poi.hpsf.wellknown.PropertyIDMap;import org.apache.poi.hpsf.wellknown.SectionIDMap;/** * <p>Convenience class representing a DocumentSummary Information stream in a * Microsoft Office document.</p> * * @author Rainer Klute <a * href="mailto:klute@rainer-klute.de"><klute@rainer-klute.de></a> * @author Drew Varner (Drew.Varner closeTo sc.edu) * @author robert_flaherty@hyperion.com * @see SummaryInformation * @version $Id: DocumentSummaryInformation.java 489730 2006-12-22 19:18:16Z bayard $ * @since 2002-02-09 */public class DocumentSummaryInformation extends SpecialPropertySet{ /** * <p>The document name a document summary information stream * usually has in a POIFS filesystem.</p> */ public static final String DEFAULT_STREAM_NAME = "\005DocumentSummaryInformation"; /** * <p>Creates a {@link DocumentSummaryInformation} from a given * {@link PropertySet}.</p> * * @param ps A property set which should be created from a * document summary information stream. * @throws UnexpectedPropertySetTypeException if <var>ps</var> * does not contain a document summary information stream. */ public DocumentSummaryInformation(final PropertySet ps) throws UnexpectedPropertySetTypeException { super(ps); if (!isDocumentSummaryInformation()) throw new UnexpectedPropertySetTypeException ("Not a " + getClass().getName()); } /** * <p>Returns the category (or <code>null</code>).</p> * * @return The category value */ public String getCategory() { return (String) getProperty(PropertyIDMap.PID_CATEGORY); } /** * <p>Sets the category.</p> * * @param category The category to set. */ public void setCategory(final String category) { final MutableSection s = (MutableSection) getFirstSection(); s.setProperty(PropertyIDMap.PID_CATEGORY, category); } /** * <p>Removes the category.</p> */ public void removeCategory() { final MutableSection s = (MutableSection) getFirstSection(); s.removeProperty(PropertyIDMap.PID_CATEGORY); } /** * <p>Returns the presentation format (or * <code>null</code>).</p> * * @return The presentation format value */ public String getPresentationFormat() { return (String) getProperty(PropertyIDMap.PID_PRESFORMAT); } /** * <p>Sets the presentation format.</p> * * @param presentationFormat The presentation format to set. */ public void setPresentationFormat(final String presentationFormat) { final MutableSection s = (MutableSection) getFirstSection(); s.setProperty(PropertyIDMap.PID_PRESFORMAT, presentationFormat); } /** * <p>Removes the presentation format.</p> */ public void removePresentationFormat() { final MutableSection s = (MutableSection) getFirstSection(); s.removeProperty(PropertyIDMap.PID_PRESFORMAT); } /** * <p>Returns the byte count or 0 if the {@link * DocumentSummaryInformation} does not contain a byte count.</p> * * @return The byteCount value */ public int getByteCount() { return getPropertyIntValue(PropertyIDMap.PID_BYTECOUNT); } /** * <p>Sets the byte count.</p> * * @param byteCount The byte count to set. */ public void setByteCount(final int byteCount) { final MutableSection s = (MutableSection) getFirstSection(); s.setProperty(PropertyIDMap.PID_BYTECOUNT, byteCount); } /** * <p>Removes the byte count.</p> */ public void removeByteCount() { final MutableSection s = (MutableSection) getFirstSection(); s.removeProperty(PropertyIDMap.PID_BYTECOUNT); } /** * <p>Returns the line count or 0 if the {@link * DocumentSummaryInformation} does not contain a line count.</p> * * @return The line count value */ public int getLineCount() { return getPropertyIntValue(PropertyIDMap.PID_LINECOUNT); } /** * <p>Sets the line count.</p> * * @param lineCount The line count to set. */ public void setLineCount(final int lineCount) { final MutableSection s = (MutableSection) getFirstSection(); s.setProperty(PropertyIDMap.PID_LINECOUNT, lineCount); } /** * <p>Removes the line count.</p> */ public void removeLineCount() { final MutableSection s = (MutableSection) getFirstSection(); s.removeProperty(PropertyIDMap.PID_LINECOUNT); } /** * <p>Returns the par count or 0 if the {@link * DocumentSummaryInformation} does not contain a par count.</p> * * @return The par count value */ public int getParCount() { return getPropertyIntValue(PropertyIDMap.PID_PARCOUNT); } /** * <p>Sets the par count.</p> * * @param parCount The par count to set. */ public void setParCount(final int parCount) { final MutableSection s = (MutableSection) getFirstSection(); s.setProperty(PropertyIDMap.PID_PARCOUNT, parCount); } /** * <p>Removes the par count.</p> */ public void removeParCount() { final MutableSection s = (MutableSection) getFirstSection(); s.removeProperty(PropertyIDMap.PID_PARCOUNT); } /** * <p>Returns the slide count or 0 if the {@link * DocumentSummaryInformation} does not contain a slide count.</p> * * @return The slide count value */ public int getSlideCount() { return getPropertyIntValue(PropertyIDMap.PID_SLIDECOUNT); } /** * <p>Sets the slideCount.</p> * * @param slideCount The slide count to set. */ public void setSlideCount(final int slideCount) { final MutableSection s = (MutableSection) getFirstSection(); s.setProperty(PropertyIDMap.PID_SLIDECOUNT, slideCount); } /** * <p>Removes the slide count.</p> */ public void removeSlideCount() { final MutableSection s = (MutableSection) getFirstSection(); s.removeProperty(PropertyIDMap.PID_SLIDECOUNT); } /** * <p>Returns the note count or 0 if the {@link * DocumentSummaryInformation} does not contain a note count.</p> * * @return The note count value */ public int getNoteCount() { return getPropertyIntValue(PropertyIDMap.PID_NOTECOUNT); } /** * <p>Sets the note count.</p> * * @param noteCount The note count to set. */ public void setNoteCount(final int noteCount) { final MutableSection s = (MutableSection) getFirstSection(); s.setProperty(PropertyIDMap.PID_NOTECOUNT, noteCount); } /** * <p>Removes the noteCount.</p> */ public void removeNoteCount() { final MutableSection s = (MutableSection) getFirstSection(); s.removeProperty(PropertyIDMap.PID_NOTECOUNT); } /** * <p>Returns the hidden count or 0 if the {@link * DocumentSummaryInformation} does not contain a hidden * count.</p> * * @return The hidden count value */ public int getHiddenCount() { return getPropertyIntValue(PropertyIDMap.PID_HIDDENCOUNT); } /** * <p>Sets the hidden count.</p> * * @param hiddenCount The hidden count to set. */ public void setHiddenCount(final int hiddenCount) { final MutableSection s = (MutableSection) getSections().get(0); s.setProperty(PropertyIDMap.PID_HIDDENCOUNT, hiddenCount); } /** * <p>Removes the hidden count.</p> */ public void removeHiddenCount() { final MutableSection s = (MutableSection) getFirstSection(); s.removeProperty(PropertyIDMap.PID_HIDDENCOUNT); } /** * <p>Returns the mmclip count or 0 if the {@link * DocumentSummaryInformation} does not contain a mmclip * count.</p> * * @return The mmclip count value
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -