1 2 /* ==================================================================== 3 Copyright 2002-2004 Apache Software Foundation 4 5 Licensed under the Apache License, Version 2.0 (the "License"); 6 you may not use this file except in compliance with the License. 7 You may obtain a copy of the License at 8 9 http://www.apache.org/licenses/LICENSE-2.0 10 11 Unless required by applicable law or agreed to in writing, software 12 distributed under the License is distributed on an "AS IS" BASIS, 13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 See the License for the specific language governing permissions and 15 limitations under the License. 16 ==================================================================== */ 17 18 19 package org.apache.poi.poifs.dev; 20 21 import java.util.Iterator; 22 23 /** 24 * Interface for a drill-down viewable object. Such an object has 25 * content that may or may not be displayed, at the discretion of the 26 * viewer. The content is returned to the viewer as an array or as an 27 * Iterator, and the object provides a clue as to which technique the 28 * viewer should use to get its content. 29 * 30 * A POIFSViewable object is also expected to provide a short 31 * description of itself, that can be used by a viewer when the 32 * viewable object is collapsed. 33 * 34 * @author Marc Johnson (mjohnson at apache dot org) 35 */ 36 37 public interface POIFSViewable 38 { 39 40 /** 41 * Get an array of objects, some of which may implement 42 * POIFSViewable 43 * 44 * @return an array of Object; may not be null, but may be empty 45 */ 46 47 public Object [] getViewableArray(); 48 49 /** 50 * Get an Iterator of objects, some of which may implement 51 * POIFSViewable 52 * 53 * @return an Iterator; may not be null, but may have an empty 54 * back end store 55 */ 56 57 public Iterator getViewableIterator(); 58 59 /** 60 * Give viewers a hint as to whether to call getViewableArray or 61 * getViewableIterator 62 * 63 * @return true if a viewer should call getViewableArray, false if 64 * a viewer should call getViewableIterator 65 */ 66 67 public boolean preferArray(); 68 69 /** 70 * Provides a short description of the object, to be used when a 71 * POIFSViewable object has not provided its contents. 72 * 73 * @return short description 74 */ 75 76 public String getShortDescription(); 77 } // end public interface POIFSViewable 78 79