ElementAt() public method

public ElementAt ( int position ) : object
position int
return object
Exemplo n.º 1
0
        public void CreateSimpleTuple()
        {
            Tuple tuple = new Tuple(new object[] { 1, 2, 3 });

            Assert.AreEqual(3, tuple.Arity);
            Assert.AreEqual(1, tuple.ElementAt(0));
            Assert.AreEqual(2, tuple.ElementAt(1));
            Assert.AreEqual(3, tuple.ElementAt(2));
        }
Exemplo n.º 2
0
        public bool Match(Tuple tuple, Context context)
        {
            if (tuple == null)
                return false;

            if (tuple.Arity != this.Arity)
                return false;

            for (int k = 0; k < this.elements.Count && context != null; k++)
                if (!AjErl.MatchUtilities.MatchObjects(this.elements[k], tuple.ElementAt(k), context))
                    return false;

            return true;
        }
Exemplo n.º 3
0
Arquivo: Tuple.cs Projeto: vis2k/AjErl
        public bool Match(Tuple tuple, Context context)
        {
            if (tuple == null)
            {
                return(false);
            }

            if (tuple.Arity != this.Arity)
            {
                return(false);
            }

            for (int k = 0; k < this.elements.Count && context != null; k++)
            {
                if (!AjErl.MatchUtilities.MatchObjects(this.elements[k], tuple.ElementAt(k), context))
                {
                    return(false);
                }
            }

            return(true);
        }