Package org.goplanit.utils.od
Class OdDataImpl<T>
- java.lang.Object
-
- org.goplanit.utils.id.IdAbleImpl
-
- org.goplanit.utils.od.OdDataImpl<T>
-
- Type Parameters:
T
- the type of data to be stored for each origin-destination cell
- All Implemented Interfaces:
Comparable<IdAble>
,Iterable<T>
,IdAble
,OdData<T>
- Direct Known Subclasses:
OdHashedImpl
,OdMatrixImpl
public abstract class OdDataImpl<T> extends IdAbleImpl implements OdData<T>
Base class containing common methods required by all classes which implement ODData- Author:
- gman6028
-
-
Constructor Summary
Constructors Constructor Description OdDataImpl(Class<? extends IdAble> idTokenClass, IdGroupingToken idToken, OdZones zones)
ConstructorOdDataImpl(OdDataImpl<T> other)
Copy Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract OdDataImpl<T>
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.int
getNumberOfOdZones()
Returns the number of zones contained in the objectprotected OdZones
getOdZones()
Access to underlying zonesabstract OdDataImpl<T>
shallowClone()
Create a shallow copy of this entity-
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
-
-
-
-
Field Detail
-
zones
protected OdZones zones
holder for zones considered in the matrix
-
-
Constructor Detail
-
OdDataImpl
public OdDataImpl(Class<? extends IdAble> idTokenClass, IdGroupingToken idToken, OdZones zones)
Constructor- Parameters:
idTokenClass
- to use for id groupingidToken
- to use for id generationzones
- zones considered in the matrix
-
OdDataImpl
public OdDataImpl(OdDataImpl<T> other)
Copy Constructor- Parameters:
other
- to copy
-
-
Method Detail
-
getOdZones
protected OdZones getOdZones()
Access to underlying zones- Returns:
- odZones
-
getNumberOfOdZones
public int getNumberOfOdZones()
Returns the number of zones contained in the object- Specified by:
getNumberOfOdZones
in interfaceOdData<T>
- Returns:
- number of zones in the object
-
shallowClone
public abstract OdDataImpl<T> shallowClone()
Create a shallow copy of this entity- Specified by:
shallowClone
in interfaceIdAble
- Specified by:
shallowClone
in interfaceOdData<T>
- Specified by:
shallowClone
in classIdAbleImpl
- Returns:
- shallow copy of entity
-
deepClone
public abstract OdDataImpl<T> 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 classIdAbleImpl
- Returns:
- deep copy of entity
-
-