public abstract class AbstractBasisMapping<T,K> extends Object implements BasisMapping<T,K>, Serializable
BasisMapping
s that implements most of the
required functionality. For any requested feature, the currently mapped
dimension is returned upon request, or a new dimension is generated if the
BasisMapping
is not in read only mode.
All access to this BasisMapping
is thread safe.Constructor and Description |
---|
AbstractBasisMapping()
Creates a new
AbstractBasisMapping . |
Modifier and Type | Method and Description |
---|---|
K |
getDimensionDescription(int dimension)
Returns a description of the specified dimension.
|
protected int |
getDimensionInternal(K key)
Returns an integer corresponding to
key . |
protected Map<K,Integer> |
getMapping()
Returns the internal mapping from keys to indices.
|
boolean |
isReadOnly()
Returns true if the
BasisMapping is read only, false otherwise. |
Set<K> |
keySet()
Returns the set of keys known by this
BasisMapping |
int |
numDimensions()
Returns the number of dimensions currently represented in this basis
mapping.
|
void |
setReadOnly(boolean readOnly)
Sets the read only state of the basis mapping.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDimension
public AbstractBasisMapping()
AbstractBasisMapping
.public K getDimensionDescription(int dimension)
getDimensionDescription
in interface BasisMapping<T,K>
dimension
- a dimension numberpublic Set<K> keySet()
BasisMapping
keySet
in interface BasisMapping<T,K>
protected int getDimensionInternal(K key)
key
. If in read only mode,
-1 is returned for unseen keys. Otherwise, unseen keys are assigned a
new dimension.public int numDimensions()
numDimensions
in interface BasisMapping<T,K>
public void setReadOnly(boolean readOnly)
setReadOnly
in interface BasisMapping<T,K>
public boolean isReadOnly()
BasisMapping
is read only, false otherwise.isReadOnly
in interface BasisMapping<T,K>
Copyright © 2012. All Rights Reserved.