Package org.goplanit.utils.wrapper
Class LongMapWrapperImpl<V>
- java.lang.Object
-
- org.goplanit.utils.wrapper.MapWrapperImpl<Long,V>
-
- org.goplanit.utils.wrapper.LongMapWrapperImpl<V>
-
- Type Parameters:
V- map value
- All Implemented Interfaces:
Cloneable,Iterable<V>,LongMapWrapper<V>,MapWrapper<Long,V>
- Direct Known Subclasses:
Demands.TimePeriods,Demands.TravelerTypes,Demands.UserClasses,GraphEntitiesImpl,ManagedIdEntitiesImpl,ProjectDemands,ProjectNetworks,ProjectOdPathSets,ProjectRoutedServices,ProjectServiceNetworks,ProjectZonings
public abstract class LongMapWrapperImpl<V> extends MapWrapperImpl<Long,V> implements LongMapWrapper<V>
Wrapper class for a map instance with Long keys- Author:
- markr
-
-
Constructor Summary
Constructors Constructor Description LongMapWrapperImpl(Map<Long,V> mapToWrap, Function<V,Long> valueToKey)ConstructorLongMapWrapperImpl(LongMapWrapperImpl<V> other)Copy constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract LongMapWrapperImpl<V>clone()Each map wrapper should be cloneable where the contents are references of the original where possible but the underlying map itself is newly createdbooleancontainsKey(long key)Verify if entry is presentVget(long key)Collect entry from container using primitiveVremove(long key)Remove value from map by the long key-
Methods inherited from class org.goplanit.utils.wrapper.MapWrapperImpl
clear, contains, createEmptyInstance, findFirst, get, getKeyByValue, getMap, getValueToKey, isEmpty, iterator, register, remove, setMap, size, toCollection, valuesAsNewSet
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Methods inherited from interface org.goplanit.utils.wrapper.MapWrapper
addAll, clear, contains, findFirst, forEachIn, get, getFirst, getKeyByValue, isEmpty, register, remove, size, toCollection, valuesAsNewSet
-
-
-
-
Constructor Detail
-
LongMapWrapperImpl
public LongMapWrapperImpl(Map<Long,V> mapToWrap, Function<V,Long> valueToKey)
Constructor- Parameters:
mapToWrap- the map to wrapvalueToKey- function to map a value to its key
-
LongMapWrapperImpl
public LongMapWrapperImpl(LongMapWrapperImpl<V> other)
Copy constructor- Parameters:
other- to copy
-
-
Method Detail
-
remove
public V remove(long key)
Remove value from map by the long key- Specified by:
removein interfaceLongMapWrapper<V>- Parameters:
key- to remove- Returns:
- removed entry if any
-
get
public V get(long key)
Collect entry from container using primitive- Specified by:
getin interfaceLongMapWrapper<V>- Parameters:
key- to use- Returns:
- value found
-
containsKey
public boolean containsKey(long key)
Verify if entry is present- Specified by:
containsKeyin interfaceLongMapWrapper<V>- Parameters:
key- to use- Returns:
- true when present, false otherwise
-
clone
public abstract LongMapWrapperImpl<V> clone()
Each map wrapper should be cloneable where the contents are references of the original where possible but the underlying map itself is newly created- Specified by:
clonein interfaceMapWrapper<Long,V>- Overrides:
clonein classMapWrapperImpl<Long,V>- Returns:
- copy
-
-