Fan.Sys.List.copyInto C# (CSharp) Method

copyInto() public method

public copyInto ( object a, int off, int len ) : object[]
a object
off int
len int
return object[]
        public object[] copyInto(object[] a, int off, int len)
        {
            try
              {
            Array.Copy(m_values, 0, a, off, len);
            return a;
              }
              catch (IndexOutOfRangeException)
              {
            throw IndexErr.make().val;
              }
        }

Usage Example

Example #1
0
            public override object callOn(object target, List args)
            {
                int  argsSize     = args == null ? 0 : args.sz();
                bool dotnetStatic = _isStatic();
                bool fanStatic    = ((m.m_flags & (FConst.Static | FConst.Ctor)) != 0);

                if (dotnetStatic && !fanStatic)
                {
                    // if Java static doesn't match Fantom static, then this is
                    // a FanXXX method which we need to call as Java static
                    int      p = checkArgs(argsSize, false, true);
                    object[] a = new object[p + 1];
                    a[0] = target;
                    if (args != null && a.Length > 0)
                    {
                        args.copyInto(a, 1, a.Length - 1);
                    }
                    return(m.invoke(null, a));
                }
                else
                {
                    // we don't include target as part of arguments
                    int      p = checkArgs(argsSize, dotnetStatic, true);
                    object[] a = new object[p];
                    if (args != null && a.Length > 0)
                    {
                        args.toArray(a, 0, a.Length);
                    }
                    return(m.invoke(target, a));
                }
            }
All Usage Examples Of Fan.Sys.List::copyInto