Package gov.nih.mipav.model.file
Class MetadataExtractor.Metadata
- java.lang.Object
-
- gov.nih.mipav.model.file.MetadataExtractor.Metadata
-
- Enclosing class:
- MetadataExtractor
public final class MetadataExtractor.Metadata extends java.lang.ObjectA top-level object that holds the metadata values extracted from an image.Metadata objects may contain zero or more
MetadataExtractor.Directoryobjects. Each directory may contain zero or more tags with corresponding values.- Author:
- Drew Noakes https://drewnoakes.com
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<MetadataExtractor.Directory>_directoriesThe list ofMetadataExtractor.Directoryinstances in this container, in the order they were added.
-
Constructor Summary
Constructors Constructor Description Metadata()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends MetadataExtractor.Directory>
voidaddDirectory(T directory)Adds a directory to this metadata collection.booleancontainsDirectoryOfType(java.lang.Class<? extends MetadataExtractor.Directory> type)Indicates whether an instance of the given directory type exists in this Metadata instance.java.lang.Iterable<MetadataExtractor.Directory>getDirectories()Returns an iterable set of theMetadataExtractor.Directoryinstances contained in this metadata collection.<T extends MetadataExtractor.Directory>
java.util.Collection<T>getDirectoriesOfType(java.lang.Class<T> type)intgetDirectoryCount()Returns the count of directories in this metadata collection.<T extends MetadataExtractor.Directory>
TgetFirstDirectoryOfType(java.lang.Class<T> type)Gets the firstMetadataExtractor.Directoryof the specified type contained within this metadata collection.MetadataExtractor.ExifSubIFDDirectorygetFirstExifSubIFDDirectory()MetadataExtractor.HuffmanTablesDirectorygetFirstHuffmanTablesDirectory()booleanhasErrors()Indicates whether any errors were reported during the reading of metadata values.java.lang.StringtoString()
-
-
-
Field Detail
-
_directories
private final java.util.List<MetadataExtractor.Directory> _directories
The list ofMetadataExtractor.Directoryinstances in this container, in the order they were added.
-
-
Method Detail
-
getDirectories
public java.lang.Iterable<MetadataExtractor.Directory> getDirectories()
Returns an iterable set of theMetadataExtractor.Directoryinstances contained in this metadata collection.- Returns:
- an iterable set of directories
-
getDirectoriesOfType
public <T extends MetadataExtractor.Directory> java.util.Collection<T> getDirectoriesOfType(java.lang.Class<T> type)
-
getDirectoryCount
public int getDirectoryCount()
Returns the count of directories in this metadata collection.- Returns:
- the number of unique directory types set for this metadata collection
-
addDirectory
public <T extends MetadataExtractor.Directory> void addDirectory(T directory)
Adds a directory to this metadata collection.- Parameters:
directory- theMetadataExtractor.Directoryto add into this metadata collection.
-
getFirstDirectoryOfType
public <T extends MetadataExtractor.Directory> T getFirstDirectoryOfType(java.lang.Class<T> type)
Gets the firstMetadataExtractor.Directoryof the specified type contained within this metadata collection. If no instances of this type are present,nullis returned.- Type Parameters:
T- the Directory type- Parameters:
type- the Directory type- Returns:
- the first Directory of type T in this metadata collection, or
nullif none exist
-
getFirstHuffmanTablesDirectory
public MetadataExtractor.HuffmanTablesDirectory getFirstHuffmanTablesDirectory()
-
getFirstExifSubIFDDirectory
public MetadataExtractor.ExifSubIFDDirectory getFirstExifSubIFDDirectory()
-
containsDirectoryOfType
public boolean containsDirectoryOfType(java.lang.Class<? extends MetadataExtractor.Directory> type)
Indicates whether an instance of the given directory type exists in this Metadata instance.- Parameters:
type- theMetadataExtractor.Directorytype- Returns:
trueif aMetadataExtractor.Directoryof the specified type exists, otherwisefalse
-
hasErrors
public boolean hasErrors()
Indicates whether any errors were reported during the reading of metadata values. This value will be true if Directory.hasErrors() is true for one of the containedMetadataExtractor.Directoryobjects.- Returns:
- whether one of the contained directories has an error
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-