Class CompoundTermImpl

    • Constructor Summary

      Constructors 
      Constructor Description
      CompoundTermImpl​(java.lang.Object[] term)
      Construct a compound term from an Object array.
      CompoundTermImpl​(java.lang.String functor, java.lang.Object a1)
      Convenience constructor for compound terms with arity 1.
      CompoundTermImpl​(java.lang.String functor, java.lang.Object[] args)
      Construct a compound term from a String and an Object array.
      CompoundTermImpl​(java.lang.String functor, java.lang.Object a1, java.lang.Object a2)
      Convenience constructor for terms with arity 2.
      CompoundTermImpl​(java.lang.String functor, java.lang.Object a1, java.lang.Object a2, java.lang.Object a3)
      Convenience constructor for compound terms with arity 3.
      CompoundTermImpl​(java.lang.String functor, java.lang.Object a1, java.lang.Object a2, java.lang.Object a3, java.lang.Object a4)
      Convenience constructor for compound terms with arity 4.
      CompoundTermImpl​(java.lang.String functor, java.lang.Object a1, java.lang.Object a2, java.lang.Object a3, java.lang.Object a4, java.lang.Object a5)
      Convenience constructor for compound terms with arity 5.
    • Constructor Detail

      • CompoundTermImpl

        public CompoundTermImpl​(java.lang.Object[] term)
        Construct a compound term from an Object array. In this constructor the functor (which should be a String) is passed in as element 0 of the array parameter, the other arguments, which can be instances of any Java classes/interfaces representing ECLiPSe types, are the remaining elements of the array. The arity is therefore the size of the array - 1.
      • CompoundTermImpl

        public CompoundTermImpl​(java.lang.String functor,
                                java.lang.Object[] args)
        Construct a compound term from a String and an Object array. User supplies functor and an array of argument objects. Arity of the resulting compound term is args.length.
      • CompoundTermImpl

        public CompoundTermImpl​(java.lang.String functor,
                                java.lang.Object a1)
        Convenience constructor for compound terms with arity 1.
      • CompoundTermImpl

        public CompoundTermImpl​(java.lang.String functor,
                                java.lang.Object a1,
                                java.lang.Object a2)
        Convenience constructor for terms with arity 2.
      • CompoundTermImpl

        public CompoundTermImpl​(java.lang.String functor,
                                java.lang.Object a1,
                                java.lang.Object a2,
                                java.lang.Object a3)
        Convenience constructor for compound terms with arity 3.
      • CompoundTermImpl

        public CompoundTermImpl​(java.lang.String functor,
                                java.lang.Object a1,
                                java.lang.Object a2,
                                java.lang.Object a3,
                                java.lang.Object a4)
        Convenience constructor for compound terms with arity 4.
      • CompoundTermImpl

        public CompoundTermImpl​(java.lang.String functor,
                                java.lang.Object a1,
                                java.lang.Object a2,
                                java.lang.Object a3,
                                java.lang.Object a4,
                                java.lang.Object a5)
        Convenience constructor for compound terms with arity 5.
    • Method Detail

      • arg

        public java.lang.Object arg​(int i)
        Return one of the term's arguments. These may be instances of any Java class/interface representing an ECLiPSe type.
        Specified by:
        arg in interface CompoundTerm
        Parameters:
        i - the argument index. This may vary between 1 and arity() inclusive.
      • argCT

        public CompoundTermImpl argCT​(int i)
        Return the argument at position i, as a CompoundTermImpl. This operation is the same as arg, except that it tries to cast the result to a CompoundTermImpl. Useful for extracting nested objects: eg. a = result.argCT(1).argCT(3).argCT(3);
        Parameters:
        i - may vary between 1 and arity()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object