public abstract class LazyDatasetBase extends Object implements ILazyDataset, Serializable
Modifier and Type | Field and Description |
---|---|
protected ConcurrentMap<Class<? extends MetadataType>,List<MetadataType>> |
metadata |
protected String |
name |
protected int[] |
shape
The shape or dimensions of the dataset
|
Constructor and Description |
---|
LazyDatasetBase() |
Modifier and Type | Method and Description |
---|---|
void |
addMetadata(MetadataType metadata)
Add metadata to the dataset
|
static int[] |
checkPermutatedAxes(int[] shape,
int... axes)
Check permutation axes
|
protected void |
checkSliceND(SliceND slice)
Check if slice is compatible with dataset's shape
|
void |
clearMetadata(Class<? extends MetadataType> clazz)
Remove metadata of given class
|
LazyDatasetBase |
clone()
Clone dataset
|
protected ConcurrentMap<Class<? extends MetadataType>,List<MetadataType>> |
copyMetadata() |
protected static ConcurrentMap<Class<? extends MetadataType>,List<MetadataType>> |
copyMetadata(Map<Class<? extends MetadataType>,List<MetadataType>> metadata) |
protected ILazyDataset |
createFromSerializable(Serializable blob,
boolean keepLazy) |
protected void |
dirtyMetadata()
Dirty metadata that are annotated by @Dirtiable.
|
boolean |
equals(Object obj) |
static Class<? extends MetadataType> |
findMetadataTypeSubInterfaces(Class<? extends MetadataType> clazz)
Find first sub-interface of (or class that directly implements) MetadataType
|
abstract int |
getDType() |
protected ErrorMetadata |
getErrorMetadata() |
ILazyDataset |
getErrors()
Get the errors, if any.
|
<T extends MetadataType> |
getFirstMetadata(Class<T> clazz) |
IMetadata |
getMetadata()
Deprecated.
|
<T extends MetadataType> |
getMetadata(Class<T> clazz) |
protected static ConcurrentMap<Class<? extends MetadataType>,List<MetadataType>> |
getMetadataMap(ILazyDataset a,
boolean clone) |
String |
getName() |
int |
getRank()
The rank (or number of dimensions/indices) of the dataset can be zero for a zero-rank
(single-valued) dataset
|
int[] |
getShape()
The shape (or array of lengths for each dimension) of the dataset can be empty for zero-rank
datasets
|
boolean |
hasErrors()
If error information is set, returns true.
|
int |
hashCode() |
protected void |
reshapeMetadata(int[] oldShape,
int[] newShape)
Reshape all datasets in metadata that are annotated by @Reshapeable.
|
protected void |
restoreMetadata(Map<Class<? extends MetadataType>,List<MetadataType>> oldMetadata) |
void |
setDirty()
This method allows anything that dirties the dataset to clear various metadata values
so that the other methods can work correctly.
|
void |
setErrors(Serializable errors)
Set the errors.
|
void |
setMetadata(MetadataType metadata)
Set metadata on the dataset
|
void |
setName(String name) |
protected void |
sliceMetadata(boolean asView,
SliceND slice)
Slice all datasets in metadata that are annotated by @Sliceable.
|
protected void |
transposeMetadata(int[] axesMap)
Transpose all datasets in metadata that are annotated by @Transposable.
|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getElementClass, getElementsPerItem, getSize, getSlice, getSlice, getSlice, getSlice, getSlice, getSlice, getSliceView, getSliceView, getSliceView, getTransposedView, setShape, squeezeEnds
protected int[] shape
protected ConcurrentMap<Class<? extends MetadataType>,List<MetadataType>> metadata
public LazyDatasetBase()
public abstract int getDType()
public LazyDatasetBase clone()
ILazyDataset
clone
in interface ILazyDataset
clone
in class Object
public int[] getShape()
ILazyDataset
getShape
in interface ILazyDataset
public int getRank()
ILazyDataset
getRank
in interface ILazyDataset
public void setDirty()
protected void checkSliceND(SliceND slice)
slice
- to checkpublic static Class<? extends MetadataType> findMetadataTypeSubInterfaces(Class<? extends MetadataType> clazz)
clazz
- metadata typeIllegalArgumentException
- when given class is MetadataType
or an anonymous sub-class of itpublic void setMetadata(MetadataType metadata)
ILazyDataset
setMetadata
in interface ILazyDataset
metadata
- (null is ignored so use clear(null) instead)public void addMetadata(MetadataType metadata)
ILazyDataset
addMetadata
in interface ILazyDataset
metadata
- to add@Deprecated public IMetadata getMetadata()
getMetadata
in interface IMetadataProvider
public <T extends MetadataType> List<T> getMetadata(Class<T> clazz) throws MetadataException
getMetadata
in interface IMetadataProvider
T
- metadata sub-interfaceclazz
- if null return everythingMetadataException
- when failing to fetch metadatapublic <T extends MetadataType> T getFirstMetadata(Class<T> clazz)
getFirstMetadata
in interface IMetadataProvider
T
- metadata sub-interfaceclazz
- if null return first from everythingpublic void clearMetadata(Class<? extends MetadataType> clazz)
ILazyDataset
clearMetadata
in interface ILazyDataset
clazz
- if null remove everythingprotected ConcurrentMap<Class<? extends MetadataType>,List<MetadataType>> copyMetadata()
protected static ConcurrentMap<Class<? extends MetadataType>,List<MetadataType>> copyMetadata(Map<Class<? extends MetadataType>,List<MetadataType>> metadata)
metadata
- typeprotected void restoreMetadata(Map<Class<? extends MetadataType>,List<MetadataType>> oldMetadata)
protected static ConcurrentMap<Class<? extends MetadataType>,List<MetadataType>> getMetadataMap(ILazyDataset a, boolean clone)
a
- datasetclone
- if true, copy metadataprotected void sliceMetadata(boolean asView, SliceND slice)
asView
- if true then just a viewslice
- an n-D sliceprotected void reshapeMetadata(int[] oldShape, int[] newShape)
oldShape
- old shapenewShape
- new shapeprotected void transposeMetadata(int[] axesMap)
axesMap
- if zero length then axes order reversedprotected void dirtyMetadata()
protected ILazyDataset createFromSerializable(Serializable blob, boolean keepLazy)
public void setErrors(Serializable errors)
ILazyDataset
setErrors
in interface ILazyDataset
errors
- - may be null to remove the error setprotected ErrorMetadata getErrorMetadata()
public ILazyDataset getErrors()
ILazyDataset
getErrors
in interface ILazyDataset
public boolean hasErrors()
ILazyDataset
hasErrors
in interface ILazyDataset
public static int[] checkPermutatedAxes(int[] shape, int... axes)
shape
- to useaxes
- if zero length then axes order reversedCopyright © 2014–2022 Eclipse Foundation. All rights reserved.