Esempio n. 1
0
        public virtual ATermList removeElementAt(int index)
        {
            if (0 > index || index > length)
            {
                throw new ArgumentException("illegal list index: " + index);
            }

            if (index == 0)
            {
                return(next);
            }

            return(next.removeElementAt(index - 1).insert(first));
        }
Esempio n. 2
0
		/**
		 * Filter multiples of n.
		 */
		private ATermList filterMultiples(int n, ATermList numbers) 
		{
			int nr, len = numbers.getLength();

			for(int i=0; i<len; i++) 
			{
				ATermInt el = (ATermInt)numbers.elementAt(i);
				nr = el.getInt();
				if(nr % n == 0) 
				{
					len--;
					numbers = numbers.removeElementAt(i);
				}
			}
			return numbers;
		}
Esempio n. 3
0
        /**
         * Filter multiples of n.
         */
        private ATermList filterMultiples(int n, ATermList numbers)
        {
            int nr, len = numbers.getLength();

            for (int i = 0; i < len; i++)
            {
                ATermInt el = (ATermInt)numbers.elementAt(i);
                nr = el.getInt();
                if (nr % n == 0)
                {
                    len--;
                    numbers = numbers.removeElementAt(i);
                }
            }
            return(numbers);
        }