Package org.goplanit.utils.od
Class OdMatrixImpl<T,U>
- java.lang.Object
-
- org.goplanit.utils.id.IdAbleImpl
-
- org.goplanit.utils.od.OdDataImpl<T>
-
- org.goplanit.utils.od.OdMatrixImpl<T,U>
-
- Direct Known Subclasses:
OdNonPrimitiveMatrix
,OdPrimitiveMatrix
public abstract class OdMatrixImpl<T,U> extends OdDataImpl<T> implements OdMatrix<T,U>
This class contains common methods for handling origin-demand matrices.- Author:
- gman6028, markr
-
-
Field Summary
Fields Modifier and Type Field Description protected U
matrixContents
matrix of data values-
Fields inherited from class org.goplanit.utils.od.OdDataImpl
zones
-
-
Constructor Summary
Constructors Constructor Description OdMatrixImpl(Class<? extends IdAble> idTokenClass, IdGroupingToken idToken, OdZones zones, U matrixContents)
Constructor for Od matrix containing primitives, i.e.OdMatrixImpl(OdMatrixImpl<T,U> other)
Copy Constructor (shallow copy of matrix contents)
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract OdMatrixImpl<T,U>
deepClone()
An id entity should always support a deep copy, i.e., all "owned" members will be deep copied when a clone of this instance is created via this call.abstract OdMatrixIterator<T,U>
iterator()
Returns an iterator which can iterate through all the origin-destination cells in the matrixabstract OdMatrixImpl<T,U>
shallowClone()
Create a shallow copy of this entity-
Methods inherited from class org.goplanit.utils.od.OdDataImpl
getNumberOfOdZones, getOdZones
-
Methods inherited from class org.goplanit.utils.id.IdAbleImpl
equals, generateAndSetId, generateId, getId, hashCode, setId
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.goplanit.utils.id.IdAble
compareTo, getId, idEquals, idHashCode
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface org.goplanit.utils.od.OdData
getNumberOfOdZones, getValue, getValue, setValue
-
-
-
-
Field Detail
-
matrixContents
protected U matrixContents
matrix of data values
-
-
Constructor Detail
-
OdMatrixImpl
public OdMatrixImpl(Class<? extends IdAble> idTokenClass, IdGroupingToken idToken, OdZones zones, U matrixContents)
Constructor for Od matrix containing primitives, i.e. number based- Parameters:
idTokenClass
- to use for id generationidToken
- to use for the matrix idzones
- holder for zones considered in the matrixmatrixContents
- container for the matrix contents
-
OdMatrixImpl
public OdMatrixImpl(OdMatrixImpl<T,U> other)
Copy Constructor (shallow copy of matrix contents)- Parameters:
other
- to copy
-
-
Method Detail
-
iterator
public abstract OdMatrixIterator<T,U> iterator()
Returns an iterator which can iterate through all the origin-destination cells in the matrix
-
shallowClone
public abstract OdMatrixImpl<T,U> shallowClone()
Create a shallow copy of this entity- Specified by:
shallowClone
in interfaceIdAble
- Specified by:
shallowClone
in interfaceOdData<T>
- Specified by:
shallowClone
in classOdDataImpl<T>
- Returns:
- shallow copy of entity
-
deepClone
public abstract OdMatrixImpl<T,U> deepClone()
An id entity should always support a deep copy, i.e., all "owned" members will be deep copied when a clone of this instance is created via this call. To be used with caution if not called by managed id container related code- Specified by:
deepClone
in interfaceIdAble
- Specified by:
deepClone
in classOdDataImpl<T>
- Returns:
- deep copy of entity
-
-