Package loci.formats
Class MetadataList<T>
java.lang.Object
loci.formats.MetadataList<T>
- Type Parameters:
T- The type of metadata to store.
- Direct Known Subclasses:
CoreMetadataList
A container of metadata for FormatReader and other reader implementations. The structure is designed to contain
data for individual image series', including sub-resolutions. This is implemented internally as a list of
lists indexed by series and resolution index. However, it may be used to store any data in a two-level
structure.
The container may be sized up front at the primary or at both levels. Or either level may be appended to
individually. Both patterns are used by many different readers.
This class was originally developed to store the CoreMetadata for image series and sub-resolutions. However, it
may be used to store any other data, for example reader-specific data including IFD mappings, extended
metadata, etc.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMetadataList(int size1) Construct a list containing a specified number of primary elements.MetadataList(int[] sizes) Construct a list containing a specified number of primary and secondary elements.MetadataList(int size1, int size2) Construct a list containing a specified number of primary elements and a fixed number of secondary elements.MetadataList(MetadataList<T> copy) Copy a list. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd()Add a empty primary array element.voidadd(int size2) Add a empty primary array element.voidAdd a secondary array element to the specified primary arrayvoidAdd a new primary element containing the specified values.voidAdd a new primary element containing a single specified value.voidclear()Clear the array.voidclear(int i1) Clear the specified primary array element.get(int i1, int i2) Get the array element for the specified indexes.remove(int i1) Remove the entire primary array element at the specified index.remove(int i1, int i2) Remove the array element at the specified indexes.voidSet the array element for the specified indexes.intsize()Get the size of the array (number of primary array elements).intsize(int i1) Get the size of the specified primary array element (number of secondary array elements).int[]sizes()Get the sizes of all primary array elements.
-
Field Details
-
data
-
-
Constructor Details
-
MetadataList
public MetadataList() -
MetadataList
Copy a list. -
MetadataList
public MetadataList(int size1) Construct a list containing a specified number of primary elements. This may be used to specify e.g. the number of image series without any sub-resolutions. The sub-resolutions, including the full resolution, must be added afterward.- Parameters:
size1- The number of primary list elements
-
MetadataList
public MetadataList(int size1, int size2) Construct a list containing a specified number of primary elements and a fixed number of secondary elements. This may be used to specify e.g. the number of image series with a fixed number of sub-resolutions.- Parameters:
size1- The number of primary list elementssize2- The number of secondary level list elements
-
MetadataList
public MetadataList(int[] sizes) Construct a list containing a specified number of primary and secondary elements. This may be used to specify e.g. the number of image series including all sub-resolutions.- Parameters:
sizes- The number of primary and secondary list elements; the array elements are the secondary element sizes.
-
-
Method Details
-
get
Get the array element for the specified indexes.- Parameters:
i1- The primary array indexi2- The secondary array index- Returns:
- The element
-
set
Set the array element for the specified indexes.- Parameters:
i1- The primary array indexi2- The secondary array indexvalue- The element to set
-
remove
Remove the array element at the specified indexes.- Parameters:
i1- The primary array indexi2- The secondary array index- Returns:
- the removed element
-
remove
Remove the entire primary array element at the specified index.- Parameters:
i1- The primary array index- Returns:
- the removed element
-
add
public void add()Add a empty primary array element. -
add
public void add(int size2) Add a empty primary array element. The number of secondary level list elements -
add
Add a secondary array element to the specified primary array- Parameters:
i1- The primary array indexvalue- The element to set
-
add
Add a new primary element containing a single specified value.- Parameters:
value- The value to add
-
add
Add a new primary element containing the specified values.- Parameters:
values- The values to add
-
clear
public void clear()Clear the array. -
clear
public void clear(int i1) Clear the specified primary array element.- Parameters:
i1- The primary array index
-
size
public int size()Get the size of the array (number of primary array elements).- Returns:
- The size
-
size
public int size(int i1) Get the size of the specified primary array element (number of secondary array elements).- Parameters:
i1- The primary array index- Returns:
- The size
-
sizes
public int[] sizes()Get the sizes of all primary array elements.- Returns:
- An array containing the size of each primary element
-