Fan.Sys.Type.toListOf C# (CSharp) Method

toListOf() private method

private toListOf ( ) : Type
return Type
        public Type toListOf()
        {
            if (m_listOf == null) m_listOf = new ListType(this);
              return m_listOf;
        }

Usage Example

Example #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.Type::toListOf