@@ -167,10 +167,10 @@ public class TIFFField implements Comparable<TIFFField>, Serializable {
167
167
* </tr>
168
168
* </table>
169
169
*
170
- * @param tag The tag
171
- * @param type
172
- * @param count
173
- * @param data
170
+ * @param tag the tag number
171
+ * @param type the tag type
172
+ * @param count the number of data items present in the field
173
+ * @param data the field data
174
174
*/
175
175
public TIFFField (int tag , int type , int count , Object data ) {
176
176
this .tag = tag ;
@@ -246,6 +246,8 @@ public char[] getAsChars() {
246
246
*
247
247
* <p> A ClassCastException will be thrown if the field is not
248
248
* of type TIFF_SSHORT.
249
+ *
250
+ * @return TIFF_SSHORT data as an array of shorts (signed 16-bit integers).
249
251
*/
250
252
public short [] getAsShorts () {
251
253
return (short [])data ;
@@ -257,6 +259,8 @@ public short[] getAsShorts() {
257
259
*
258
260
* <p> A ClassCastException will be thrown if the field is not
259
261
* of type TIFF_SLONG.
262
+ *
263
+ * @return TIFF_SLONG data as an array of ints (signed 32-bit integers).
260
264
*/
261
265
public int [] getAsInts () {
262
266
return (int [])data ;
@@ -268,6 +272,8 @@ public int[] getAsInts() {
268
272
*
269
273
* <p> A ClassCastException will be thrown if the field is not
270
274
* of type TIFF_LONG.
275
+ *
276
+ * @return TIFF_LONG data as an array of longs (signed 64-bit integers).
271
277
*/
272
278
public long [] getAsLongs () {
273
279
return (long [])data ;
@@ -278,6 +284,8 @@ public long[] getAsLongs() {
278
284
*
279
285
* <p> A ClassCastException will be thrown if the field is not
280
286
* of type TIFF_FLOAT.
287
+ *
288
+ * @return TIFF_FLOAT data as an array of floats.
281
289
*/
282
290
public float [] getAsFloats () {
283
291
return (float [])data ;
@@ -288,6 +296,8 @@ public float[] getAsFloats() {
288
296
*
289
297
* <p> A ClassCastException will be thrown if the field is not
290
298
* of type TIFF_DOUBLE.
299
+ *
300
+ * @return TIFF_DOUBLE data as an array of doubles.
291
301
*/
292
302
public double [] getAsDoubles () {
293
303
return (double [])data ;
@@ -298,6 +308,8 @@ public double[] getAsDoubles() {
298
308
*
299
309
* <p> A ClassCastException will be thrown if the field is not
300
310
* of type TIFF_ASCII.
311
+ *
312
+ * @return TIFF_ASCII data as an array of strings.
301
313
*/
302
314
public String [] getAsStrings () {
303
315
return (String []) data ;
@@ -308,6 +320,8 @@ public String[] getAsStrings() {
308
320
*
309
321
* <p> A ClassCastException will be thrown if the field is not
310
322
* of type TIFF_SRATIONAL.
323
+ *
324
+ * @return TIFF_SRATIONAL data as an array of 2-element arrays of ints.
311
325
*/
312
326
public int [][] getAsSRationals () {
313
327
return (int [][])data ;
@@ -318,6 +332,8 @@ public int[][] getAsSRationals() {
318
332
*
319
333
* <p> A ClassCastException will be thrown if the field is not
320
334
* of type TIFF_RATTIONAL.
335
+ *
336
+ * @return TIFF_RATIONAL data as an array of 2-element arrays of longs.
321
337
*/
322
338
public long [][] getAsRationals () {
323
339
return (long [][])data ;
@@ -337,6 +353,8 @@ public long[][] getAsRationals() {
337
353
* TIFF_SSHORT, or TIFF_SLONG.
338
354
*
339
355
* @param index The index
356
+ * @return data in TIFF_BYTE, TIFF_SBYTE, TIFF_UNDEFINED, TIFF_SHORT, TIFF_SSHORT,
357
+ * or TIFF_SLONG format as an int.
340
358
*/
341
359
public int getAsInt (int index ) {
342
360
switch (type ) {
@@ -369,6 +387,8 @@ public int getAsInt(int index) {
369
387
* TIFF_SSHORT, TIFF_SLONG, or TIFF_LONG.
370
388
*
371
389
* @param index The index
390
+ * @return data in TIFF_BYTE, TIFF_SBYTE, TIFF_UNDEFINED, TIFF_SHORT, TIFF_SSHORT, TIFF_SLONG,
391
+ * or TIFF_LONG format as a long.
372
392
*/
373
393
public long getAsLong (int index ) {
374
394
switch (type ) {
@@ -390,17 +410,18 @@ public long getAsLong(int index) {
390
410
}
391
411
392
412
/**
393
- * Returns data in any numerical format as a float. Data in
413
+ * Returns data in any numerical format as a float. Data in
394
414
* TIFF_SRATIONAL or TIFF_RATIONAL format are evaluated by
395
415
* dividing the numerator into the denominator using
396
416
* double-precision arithmetic and then truncating to single
397
- * precision. Data in TIFF_SLONG, TIFF_LONG, or TIFF_DOUBLE
417
+ * precision. Data in TIFF_SLONG, TIFF_LONG, or TIFF_DOUBLE
398
418
* format may suffer from truncation.
399
419
*
400
420
* <p> A ClassCastException will be thrown if the field is
401
421
* of type TIFF_UNDEFINED or TIFF_ASCII.
402
422
*
403
423
* @param index The index
424
+ * @return data in any numerical format as a float.
404
425
*/
405
426
public float getAsFloat (int index ) {
406
427
switch (type ) {
@@ -432,7 +453,7 @@ public float getAsFloat(int index) {
432
453
}
433
454
434
455
/**
435
- * Returns data in any numerical format as a float. Data in
456
+ * Returns data in any numerical format as a double. Data in
436
457
* TIFF_SRATIONAL or TIFF_RATIONAL format are evaluated by
437
458
* dividing the numerator into the denominator using
438
459
* double-precision arithmetic.
@@ -441,6 +462,7 @@ public float getAsFloat(int index) {
441
462
* type TIFF_UNDEFINED or TIFF_ASCII.
442
463
*
443
464
* @param index The index
465
+ * @return data in any numerical format as a double.
444
466
*/
445
467
public double getAsDouble (int index ) {
446
468
switch (type ) {
@@ -478,6 +500,7 @@ public double getAsDouble(int index) {
478
500
* of type TIFF_ASCII.
479
501
*
480
502
* @param index The index
503
+ * @return a TIFF_ASCII data item as a String.
481
504
*/
482
505
public String getAsString (int index ) {
483
506
return ((String [])data )[index ];
@@ -491,6 +514,7 @@ public String getAsString(int index) {
491
514
* of type TIFF_SRATIONAL.
492
515
*
493
516
* @param index The index
517
+ * @return a TIFF_SRATIONAL data item as a two-element array of ints.
494
518
*/
495
519
public int [] getAsSRational (int index ) {
496
520
return ((int [][])data )[index ];
@@ -504,6 +528,7 @@ public int[] getAsSRational(int index) {
504
528
* of type TIFF_RATIONAL.
505
529
*
506
530
* @param index The index
531
+ * @return a TIFF_RATIONAL data item as a two-element array of ints
507
532
*/
508
533
public long [] getAsRational (int index ) {
509
534
if (type == TIFF_LONG )
0 commit comments