Package org.eolang

Class PhTraced

  • All Implemented Interfaces:
    Data, Phi, Term

    public final class PhTraced
    extends Object
    implements Phi
    Class to trace if the "cage.new" got into recursion during the dataization.

    This class is thread safe in the meaning that different threads can safely use different instances of the class and recursion (If a thread dataizes the same recursively) will still be detected.

    Since:
    0.36
    • Field Detail

      • RECURSION_LIMIT

        public static final String RECURSION_LIMIT
        Name of property that responsible for keeping max depth.
        See Also:
        Constant Field Values
    • Constructor Detail

      • PhTraced

        public PhTraced​(Phi object,
                        Integer locator)
        Ctor.
        Parameters:
        object - Encaged object
        locator - Locator of encaged object
      • PhTraced

        public PhTraced​(Phi object,
                        Integer locator,
                        int depth)
        The main constructor.
        Parameters:
        object - Encaged object
        locator - Locator of encaged object
        depth - Max depth of cage recursion
    • Method Detail

      • copy

        public Phi copy()
        Description copied from interface: Phi
        Make a copy, leaving it at the same parent.
        Specified by:
        copy in interface Phi
        Returns:
        A copy
      • take

        public Phi take​(String name)
        Description copied from interface: Phi
        Take object by name of the attribute.
        Specified by:
        take in interface Phi
        Parameters:
        name - The name of the attribute
        Returns:
        The object
      • put

        public boolean put​(int pos,
                           Phi obj)
        Description copied from interface: Phi
        Put object by position of the attribute.
        Specified by:
        put in interface Phi
        Parameters:
        pos - The position of the attribute.
        obj - The object to put
        Returns:
        Was attribute set
      • put

        public boolean put​(String name,
                           Phi obj)
        Description copied from interface: Phi
        Put object by name of the attribute.
        Specified by:
        put in interface Phi
        Parameters:
        name - The name of the attribute.
        obj - The object to put
        Returns:
        Was attribute set
      • locator

        public String locator()
        Description copied from interface: Phi
        Get code locator of the phi.
        Specified by:
        locator in interface Phi
        Returns:
        String containing code locator
      • forma

        public String forma()
        Description copied from interface: Phi
        Get forma of the phi.
        Specified by:
        forma in interface Phi
        Returns:
        Forma of it as String.
      • φTerm

        public String φTerm()
        Description copied from interface: Term
        To φ-calculus term, as text.
        Specified by:
        φTerm in interface Term
        Returns:
        The expression in φ-calculus
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • attach

        public void attach​(byte[] data)
        Description copied from interface: Data
        Attach data to the object.
        Specified by:
        attach in interface Data
        Parameters:
        data - Data.
      • delta

        public byte[] delta()
        Description copied from interface: Data
        Take the data.
        Specified by:
        delta in interface Data
        Returns:
        The data