public abstract class LazyDatasetBase extends Object implements ILazyDataset, Serializable
Modifier and Type | Field and Description |
---|---|
protected static boolean |
catchExceptions |
protected static org.slf4j.Logger |
logger |
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
|
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() |
Class<?> |
getElementClass() |
protected ErrorMetadata |
getErrorMetadata() |
ILazyDataset |
getErrors()
Get the errors, if any.
|
<S extends MetadataType,T extends S> |
getFirstMetadata(Class<T> clazz) |
IMetadata |
getMetadata()
Deprecated.
|
<S extends MetadataType,T extends S> |
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
getElementsPerItem, getSize, getSlice, getSlice, getSlice, getSlice, getSlice, getSlice, getSliceView, getSliceView, getSliceView, getTransposedView, setShape, squeezeEnds
protected static final org.slf4j.Logger logger
protected static boolean catchExceptions
protected int[] shape
protected ConcurrentMap<Class<? extends MetadataType>,List<MetadataType>> metadata
public LazyDatasetBase()
public abstract int getDType()
public Class<?> getElementClass()
getElementClass
in interface ILazyDataset
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()
public static Class<? extends MetadataType> findMetadataTypeSubInterfaces(Class<? extends MetadataType> clazz)
clazz
- IllegalArgumentException
- 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
@Deprecated public IMetadata getMetadata()
getMetadata
in interface IMetadataProvider
public <S extends MetadataType,T extends S> List<S> getMetadata(Class<T> clazz) throws MetadataException
getMetadata
in interface IMetadataProvider
clazz
- if null return everythingMetadataException
public <S extends MetadataType,T extends S> S getFirstMetadata(Class<T> clazz)
getFirstMetadata
in interface IMetadataProvider
clazz
- 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)
protected void restoreMetadata(Map<Class<? extends MetadataType>,List<MetadataType>> oldMetadata)
protected static ConcurrentMap<Class<? extends MetadataType>,List<MetadataType>> getMetadataMap(ILazyDataset a, boolean clone)
protected void sliceMetadata(boolean asView, SliceND slice)
asView
- if true then just a viewslice
- protected void reshapeMetadata(int[] oldShape, int[] newShape)
newShape
- protected void transposeMetadata(int[] axesMap)
axesMap
- protected 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
- axes
- Copyright © 2014–2019 Eclipse Foundation. All rights reserved.