Revision 20098 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/ExtentHistory.java
ExtentHistory.java | ||
---|---|---|
46 | 46 |
|
47 | 47 |
|
48 | 48 |
/** |
49 |
* <p>The class <code>ExtentHistory</code> is designed for managing a history of extents.</p> |
|
50 |
* <p><i>(An extent is a point of a corner and the dimensions of a rectangular area).</i></p> |
|
51 |
* <p><i>Note:</i> The class <code>ExtentHistory</code> only supports <i>get</i> |
|
52 |
* and <i>remove</i> the last extent.</p> |
|
49 |
* <p><code>ExtentHistory</code> is designed for managing a history of extents.</p> |
|
50 |
* |
|
51 |
* <p>Note: An <i>extent</i> is a rectangular area, with information of its top-left 2D corner.</p> |
|
53 | 52 |
* |
54 | 53 |
* @author Vicente Caballero Navarro |
55 | 54 |
*/ |
... | ... | |
58 | 57 |
* <p>Maximum number of extents that can store.</p> |
59 | 58 |
*/ |
60 | 59 |
private int NUMREC; |
60 |
|
|
61 | 61 |
/** |
62 | 62 |
* <p>Array with the extents.</p> |
63 | 63 |
* |
... | ... | |
67 | 67 |
* @see #removePrev() |
68 | 68 |
*/ |
69 | 69 |
private Rectangle2D[] extents; |
70 |
|
|
70 | 71 |
/** |
71 | 72 |
* <p>Number of extents stored.</p> |
72 | 73 |
* |
... | ... | |
76 | 77 |
* @see #removePrev() |
77 | 78 |
*/ |
78 | 79 |
private int num = 0; |
80 |
|
|
79 | 81 |
/** |
80 |
* <p>Creates a new instance of <code>ExtentsHistory</code> with an history of 10 |
|
81 |
* extents.</p> |
|
82 |
* <p>Creates a new instance of <code>ExtentsHistory</code> with an history of 10 extents.</p> |
|
82 | 83 |
*/ |
83 | 84 |
public ExtentHistory() { |
84 | 85 |
NUMREC = 10; |
... | ... | |
86 | 87 |
} |
87 | 88 |
|
88 | 89 |
/** |
89 |
* <p>Creates a new instance of <code>ExtentsHistory</code> with an history of |
|
90 |
* <code>numEntries</code> extents.</p> |
|
90 |
* <p>Creates a new instance of <code>ExtentsHistory</code> with an history of <code>numEntries</code> extents.</p> |
|
91 | 91 |
* |
92 | 92 |
* @param numEntries the maximum number of extents that will store the instance |
93 | 93 |
*/ |
... | ... | |
121 | 121 |
/** |
122 | 122 |
* <p>Returns <code>true</code> if there are extents registered.</p> |
123 | 123 |
* |
124 |
* @return <code>true</code> if there are extents registered; <code>false</code> |
|
125 |
* otherwise |
|
124 |
* @return <code>true</code> if there are extents registered; <code>false</code> otherwise |
|
126 | 125 |
* |
127 | 126 |
* @see #put(Rectangle2D) |
128 | 127 |
* @see #removePrev() |
... | ... | |
135 | 134 |
/** |
136 | 135 |
* <p>Returns the last extent in the history.</p> |
137 | 136 |
* |
138 |
* @return the last extent in the history?
|
|
137 |
* @return the last extent in the history |
|
139 | 138 |
* |
140 | 139 |
* @see #put(Rectangle2D) |
141 | 140 |
* @see #getXMLEntity() |
... | ... | |
147 | 146 |
} |
148 | 147 |
|
149 | 148 |
/** |
150 |
* <p>Extracts the last extent from the history.</p> |
|
149 |
* <p>Extracts (removing) the last extent from the history.</p>
|
|
151 | 150 |
* |
152 | 151 |
* @return last extent in the history |
153 | 152 |
* |
... | ... | |
159 | 158 |
} |
160 | 159 |
|
161 | 160 |
/** |
162 |
* <p>Returns an XML entity with information of this object. All information is |
|
163 |
* stored as properties:<br></p> |
|
161 |
* <p>Returns an XML entity with information of this object. All information is stored as properties:<br></p> |
|
164 | 162 |
* <p><b>Properties:</b> |
165 | 163 |
* <ul> |
166 | 164 |
* <li><i>className</i>: name of this class. |
... | ... | |
221 | 219 |
} |
222 | 220 |
|
223 | 221 |
/** |
224 |
* <p>Binds the information in the XML entity argument to create and return |
|
225 |
* an <code>ExtentHistory</code> object.</p>
|
|
222 |
* <p>Binds the information in the XML entity argument to create and return an <code>ExtentHistory</code>
|
|
223 |
* object.</p> |
|
226 | 224 |
* |
227 | 225 |
* @param xml an XML entity of a <code>ExtentHistory</code> |
228 | 226 |
* |
229 |
* @return an <code>ExtentHistory</code> object with the information of the |
|
230 |
* <code>xml</code> argument |
|
227 |
* @return an <code>ExtentHistory</code> object with the information of the <code>xml</code> argument |
|
231 | 228 |
* |
232 | 229 |
* @see #getXMLEntity() |
233 | 230 |
*/ |
Also available in: Unified diff