01: /* ====================================================================
02: Licensed to the Apache Software Foundation (ASF) under one or more
03: contributor license agreements. See the NOTICE file distributed with
04: this work for additional information regarding copyright ownership.
05: The ASF licenses this file to You under the Apache License, Version 2.0
06: (the "License"); you may not use this file except in compliance with
07: the License. You may obtain a copy of the License at
08:
09: 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: package org.apache.poi.poifs.dev;
19:
20: import java.util.Iterator;
21:
22: /**
23: * Interface for a drill-down viewable object. Such an object has
24: * content that may or may not be displayed, at the discretion of the
25: * viewer. The content is returned to the viewer as an array or as an
26: * Iterator, and the object provides a clue as to which technique the
27: * viewer should use to get its content.
28: *
29: * A POIFSViewable object is also expected to provide a short
30: * description of itself, that can be used by a viewer when the
31: * viewable object is collapsed.
32: *
33: * @author Marc Johnson (mjohnson at apache dot org)
34: */
35:
36: public interface POIFSViewable {
37:
38: /**
39: * Get an array of objects, some of which may implement
40: * POIFSViewable
41: *
42: * @return an array of Object; may not be null, but may be empty
43: */
44:
45: public Object[] getViewableArray();
46:
47: /**
48: * Get an Iterator of objects, some of which may implement
49: * POIFSViewable
50: *
51: * @return an Iterator; may not be null, but may have an empty
52: * back end store
53: */
54:
55: public Iterator getViewableIterator();
56:
57: /**
58: * Give viewers a hint as to whether to call getViewableArray or
59: * getViewableIterator
60: *
61: * @return true if a viewer should call getViewableArray, false if
62: * a viewer should call getViewableIterator
63: */
64:
65: public boolean preferArray();
66:
67: /**
68: * Provides a short description of the object, to be used when a
69: * POIFSViewable object has not provided its contents.
70: *
71: * @return short description
72: */
73:
74: public String getShortDescription();
75: } // end public interface POIFSViewable
|