Package org.eolang

Class Data.ToPhi

  • All Implemented Interfaces:
    Phi, Term
    Enclosing interface:
    Data<T>

    public static final class Data.ToPhi
    extends Object
    implements Phi
    Makes a Phi out of a Java object, like String or Integer.

    This is more convenient than making EOstring and then injecting "Δ" into it. This class is used in Java tests mostly for the sake of brevity. In auto-generated Java code we use EOint/EOstring and then inject "Δ" with Data.Value into it.

    Since:
    0.1
    • Constructor Detail

      • ToPhi

        public ToPhi​(Object obj)
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • 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
      • move

        public void move​(Phi rho)
        Description copied from interface: Phi
        Move it to a new parent.
        Specified by:
        move in interface Phi
        Parameters:
        rho - New \rho to attach to
      • attr

        public Attr attr​(int pos)
        Description copied from interface: Phi
        Get attribute by position.
        Specified by:
        attr in interface Phi
        Parameters:
        pos - The position of the attribute
        Returns:
        The attr
      • attr

        public Attr attr​(String name)
        Description copied from interface: Phi
        Get attribute.
        Specified by:
        attr in interface Phi
        Parameters:
        name - The name of the attribute
        Returns:
        The attr
      • φ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