Fan.Sys.Map.get C# (CSharp) Méthode

get() public méthode

public get ( object key ) : object
key object
Résultat object
        public object get(object key)
        {
            object val = m_map[key];
              if (val != null) return val;
              if (m_def == null) return null;
              return containsKey(key) ? null : m_def;
        }

Same methods

Map::get ( object key, object def ) : object

Usage Example

Exemple #1
0
        public virtual Type parameterize(Map pars)
        {
            if (this == Sys.ListType)
            {
                Type v = (Type)pars.get(FanStr.m_ascii['V']);
                if (v == null)
                {
                    throw ArgErr.make("List.parameterize - V undefined").val;
                }
                return(v.toListOf());
            }

            if (this == Sys.MapType)
            {
                Type v = (Type)pars.get(FanStr.m_ascii['V']);
                Type k = (Type)pars.get(FanStr.m_ascii['K']);
                if (v == null)
                {
                    throw ArgErr.make("Map.parameterize - V undefined").val;
                }
                if (k == null)
                {
                    throw ArgErr.make("Map.parameterize - K undefined").val;
                }
                return(new MapType(k, v));
            }

            if (this == Sys.FuncType)
            {
                Type r = (Type)pars.get(FanStr.m_ascii['R']);
                if (r == null)
                {
                    throw ArgErr.make("Map.parameterize - R undefined").val;
                }
                ArrayList p = new ArrayList();
                for (int i = 'A'; i <= 'H'; ++i)
                {
                    Type x = (Type)pars.get(FanStr.m_ascii[i]);
                    if (x == null)
                    {
                        break;
                    }
                    p.Add(x);
                }
                return(new FuncType((Type[])p.ToArray(System.Type.GetType("Fan.Sys.Type")), r));
            }

            throw UnsupportedErr.make("not generic: " + this).val;
        }
All Usage Examples Of Fan.Sys.Map::get