public Entry(KT theKey, VT theValue, EnumMap <KT, VT> em) //: base(theKey, theValue) { enumMap = em; ordinal = (int)(object)theKey; this.theKey = theKey; this.theValue = theValue; }
private void Initialization(EnumMap <K, V> enumMap) { keyType = enumMap.keyType; keys = enumMap.keys; enumSize = enumMap.enumSize; values = (object[])enumMap.values.Clone(); hasMapping = (bool[])enumMap.hasMapping.Clone(); mappingsCount = enumMap.mappingsCount; }
/// <summary> /// Clones this map to create a shallow copy. /// </summary> /// <returns>a shallow copy of this map</returns> public new Object Clone() { try { EnumMap <K, V> enumMap = (EnumMap <K, V>)base.MemberwiseClone(); enumMap.Initialization(this); return(enumMap); } catch (Exception) { return(null); } }
/// <summary> /// Returns true if this EnumMap is equal to the given object. /// </summary> /// <param name="obj">the object</param> /// <returns>true if this EnumMap is equal to the given object.</returns> public override bool Equals(Object obj) { if (this == obj) { return(true); } if (!(obj is EnumMap <K, V>)) { return(base.Equals(obj)); } EnumMap <K, V> enumMap = (EnumMap <K, V>)obj; if (keyType != enumMap.keyType || Count != enumMap.Count) { return(false); } return(Arrays.AreEquals(hasMapping, enumMap.hasMapping) && Arrays.AreEquals(values, enumMap.values)); }
/// <summary> /// Constructs an EnumMap using the same key type and contents as the given /// EnumMap. /// </summary> /// <param name="map">the EnumMap from which the initial contents of this EnumMap are copied</param> public EnumMap(EnumMap <K, V> map) /*where T : V*/ { Initialization(map); }
public EnumMapEntrySet(EnumMap <KT, VT> em) { enumMap = em; }
public EnumMapEntryIterator(MapEntryType <E, KT, VT> value, EnumMap <KT, VT> em) : base(value, em) { }
public EnumMapValueCollection(EnumMap <KT, VT> em) { enumMap = em; }
public EnumMapKeySet(EnumMap <KT, VT> em) { enumMap = em; }
public EnumMapIterator(MapEntryType <E, KT, VT> value, EnumMap <KT, VT> em) { enumMap = em; type = value; }