IEnumerator <IMapEntry> IEnumerable <IMapEntry> .GetEnumerator() { for (int i = 0; i < _array.Length; i += 2) { yield return((IMapEntry)MapEntry.create(_array[i], _array[i + 1])); } }
/// <summary> /// Returns the key/value pair for this key. /// </summary> /// <param name="key">The key to retrieve</param> /// <returns>The key/value pair for the key, or null if the key is not in the map.</returns> public override IMapEntry entryAt(object key) { IMapEntry me = _def.Keyslots.entryAt(key); return(me == null ? _ext.entryAt(key) : (IMapEntry)MapEntry.create(me.key(), _vals[Util.ConvertToInt(me.val())])); }
/// <summary> /// Returns the key/value pair for this key. /// </summary> /// <param name="key">The key to retrieve</param> /// <returns>The key/value pair for the key, or null if the key is not in the map.</returns> public override IMapEntry entryAt(object key) { int i = IndexOfKey(key); return(i >= 0 ? (IMapEntry)MapEntry.create(_array[i], _array[i + 1]) : null); }
public IMapEntry entryAt(object key) { Object v = valAt(key, NOT_FOUND); if (v != NOT_FOUND) { return(MapEntry.create(key, v)); } return(null); }
IEnumerator <IMapEntry> IEnumerable <IMapEntry> .GetEnumerator() { foreach (IMapEntry ime in _def.Keyslots) { yield return((IMapEntry)MapEntry.create(ime.key(), _vals[(int)ime.val()])); } foreach (IMapEntry ime in _ext) { yield return(ime); } }
/// <summary> /// Returns the key/value pair for this key. /// </summary> /// <param name="key">The key to retrieve</param> /// <returns>The key/value pair for the key, or null if the key is not in the map.</returns> public virtual IMapEntry entryAt(object key) { if (Util.IsNumeric(key)) { int i = Util.ConvertToInt(key); if (i >= 0 && i < count()) { return(MapEntry.create(key, nth(i))); } } return(null); }
public IEnumerator <object> GetEnumerator() { for (int i = 0; i < _basecnt; i++) { object k = _baseFields.nth(i); yield return(MapEntry.create(k, _rec.valAt(k))); } while (_extmap.MoveNext()) { yield return(_extmap.Current); } }
/// <summary> /// Gets the first item. /// </summary> /// <returns>The first item.</returns> public override object first() { return(MapEntry.create(_keys.first(), _vals[_i])); }
/// <summary> /// Gets the first item. /// </summary> /// <returns>The first item.</returns> public override object first() { return(MapEntry.create(_array[_i], _array[_i + 1])); }