public void testGetEntry() {
    final TiffDirectoryEntrySet entrySet = new TiffDirectoryEntrySet();
    final TiffShort tag1 = new TiffShort(45);
    final TiffDirectoryEntry entry1 = new TiffDirectoryEntry(tag1, new TiffLong(45678));
    final TiffShort tag2 = new TiffShort(60);
    final TiffDirectoryEntry entry2 = new TiffDirectoryEntry(tag2, new TiffLong(4234));
    final TiffShort tag3 = new TiffShort(44);
    final TiffDirectoryEntry entry3 = new TiffDirectoryEntry(tag3, new TiffLong(42634));
    final TiffShort noEntryTag = new TiffShort(66);

    entrySet.set(entry1);
    entrySet.set(entry2);
    entrySet.set(entry3);

    assertEquals(entry1, entrySet.getEntry(tag1));
    assertEquals(entry2, entrySet.getEntry(tag2));
    assertEquals(entry3, entrySet.getEntry(tag3));
    assertNull(entrySet.getEntry(noEntryTag));
  }
Exemplo n.º 2
0
 public TiffDirectoryEntry getEntry(final TiffShort tag) {
   return entrySet.getEntry(tag);
 }