FileDocCategorySizeDatePackage
IfdData.javaAPI DocAndroid 5.1 API4000Thu Mar 12 22:22:42 GMT 2015com.android.gallery3d.exif

IfdData

public class IfdData extends Object
This class stores all the tags in an IFD.
see
ExifData
see
ExifTag

Fields Summary
private final int
mIfdId
private final Map
mExifTags
private int
mOffsetToNextIfd
private static final int[]
sIfds
Constructors Summary
IfdData(int ifdId)
Creates an IfdData with given IFD ID.

see
IfdId#TYPE_IFD_0
see
IfdId#TYPE_IFD_1
see
IfdId#TYPE_IFD_EXIF
see
IfdId#TYPE_IFD_GPS
see
IfdId#TYPE_IFD_INTEROPERABILITY

                          
      
        mIfdId = ifdId;
    
Methods Summary
protected booleancheckCollision(short tagId)

        return mExifTags.get(tagId) != null;
    
public booleanequals(java.lang.Object obj)
Returns true if all tags in this two IFDs are equal. Note that tags of IFDs offset or thumbnail offset will be ignored.

        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (obj instanceof IfdData) {
            IfdData data = (IfdData) obj;
            if (data.getId() == mIfdId && data.getTagCount() == getTagCount()) {
                ExifTag[] tags = data.getAllTags();
                for (ExifTag tag : tags) {
                    if (ExifInterface.isOffsetTag(tag.getTagId())) {
                        continue;
                    }
                    ExifTag tag2 = mExifTags.get(tag.getTagId());
                    if (!tag.equals(tag2)) {
                        return false;
                    }
                }
                return true;
            }
        }
        return false;
    
protected ExifTag[]getAllTags()
Get a array the contains all {@link ExifTag} in this IFD.

        return mExifTags.values().toArray(new ExifTag[mExifTags.size()]);
    
protected intgetId()
Gets the ID of this IFD.

see
IfdId#TYPE_IFD_0
see
IfdId#TYPE_IFD_1
see
IfdId#TYPE_IFD_EXIF
see
IfdId#TYPE_IFD_GPS
see
IfdId#TYPE_IFD_INTEROPERABILITY

        return mIfdId;
    
protected static int[]getIfds()

        return sIfds;
    
protected intgetOffsetToNextIfd()
Gets the offset of next IFD.

        return mOffsetToNextIfd;
    
protected ExifTaggetTag(short tagId)
Gets the {@link ExifTag} with given tag id. Return null if there is no such tag.

        return mExifTags.get(tagId);
    
protected intgetTagCount()
Gets the tags count in the IFD.

        return mExifTags.size();
    
protected voidremoveTag(short tagId)
Removes the tag of the given ID

        mExifTags.remove(tagId);
    
protected voidsetOffsetToNextIfd(int offset)
Sets the offset of next IFD.

        mOffsetToNextIfd = offset;
    
protected ExifTagsetTag(ExifTag tag)
Adds or replaces a {@link ExifTag}.

        tag.setIfd(mIfdId);
        return mExifTags.put(tag.getTagId(), tag);