create() private method

private create ( object key, object val ) : MapEntry
key object
val object
return MapEntry
コード例 #1
0
 IEnumerator <IMapEntry> IEnumerable <IMapEntry> .GetEnumerator()
 {
     for (int i = 0; i < _array.Length; i += 2)
     {
         yield return((IMapEntry)MapEntry.create(_array[i], _array[i + 1]));
     }
 }
コード例 #2
0
        /// <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())]));
        }
コード例 #3
0
        /// <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);
        }
コード例 #4
0
        public IMapEntry entryAt(object key)
        {
            Object v = valAt(key, NOT_FOUND);

            if (v != NOT_FOUND)
            {
                return(MapEntry.create(key, v));
            }
            return(null);
        }
コード例 #5
0
 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);
     }
 }
コード例 #6
0
 /// <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);
 }
コード例 #7
0
        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);
            }
        }
コード例 #8
0
 /// <summary>
 /// Gets the first item.
 /// </summary>
 /// <returns>The first item.</returns>
 public override object first()
 {
     return(MapEntry.create(_keys.first(), _vals[_i]));
 }
コード例 #9
0
 /// <summary>
 /// Gets the first item.
 /// </summary>
 /// <returns>The first item.</returns>
 public override object first()
 {
     return(MapEntry.create(_array[_i], _array[_i + 1]));
 }