Пример #1
0
        //Reverses the order of the elements in an array
        public ArrayObject reverse()
        {
            ArrayObject result = this.Clone();

            result._keys.Reverse();
            result._values.Reverse();
            return(result);
        }
Пример #2
0
        //Selects a part of an array, and returns the new array
        public ArrayObject slice(int start, int end)
        {
            ArrayObject result = new ArrayObject();

            for (int a = start; a < end; a++)
            {
                result._keys.Add(this._keys[a]);
                result._values.Add(this._values[a]);
            }
            return(result);
        }
Пример #3
0
        //Joins two or more arrays, and returns a copy of the joined arrays
        public ArrayObject concat(/*params */ ArrayObject /*[]*/ toConcat)
        {
            ArrayObject result = this.Clone();

            /*foreach (ArrayObject item in toConcat)
             * {*/
            ArrayObject item = toConcat;
            int         a    = 0;

            foreach (object subItem in item._keys)
            {
                result._keys.Add(subItem);
                result._values.Add(item._values[a++]);
            }
            //}
            return(result);
        }