create() 개인적인 메소드

private create ( object key, object val ) : MapEntry
key object
val object
리턴 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]));
     }
 }
        /// <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);
        }
 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);
            }
        }
 /// <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]));
 }