Package org.eolang
Class Data.ToPhi
- java.lang.Object
-
- org.eolang.Data.ToPhi
-
- Enclosing interface:
- Data
public static final class Data.ToPhi extends Object implements Phi
Makes aPhiout of a primitive Java object, likeStringorInteger.This is more convenient than making EOstring, then making EObytes fill it up with data, and then injecting bytes to string. This class is used in Java tests mostly for the sake of brevity. In auto-generated Java code we do:
Phi bytes = Phi.Φ.take("org.eolang.bytes").copy(); Phi attached = new PhWith(bytes, 0, new byte[] {...}); Phi str = Phi.Φ.take("org.eolang.string").copy(); Phi applied = new PhWith(str, 0, attached); return applied;- Since:
- 0.1
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eolang.Data
Data.ToPhi
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Phicopy()Make a copy, leaving it at the same parent.Phicopy(Phi self)Copy self object.byte[]delta()Take the data.booleanequals(Object obj)Stringforma()Get forma of the phi.inthashCode()booleanhasRho()Returns true if object has bound rho attribute.Stringlocator()Get code locator of the phi.voidput(int pos, Phi obj)Put object by position of the attribute.voidput(String name, Phi obj)Put object by name of the attribute.Phitake(int pos)Take object by position of the attribute.Phitake(String name)Take object by name of the attribute.
-
-
-
Constructor Detail
-
ToPhi
public ToPhi(Object obj)
Ctor.- Parameters:
obj- Data
-
-
Method Detail
-
copy
public Phi copy()
Description copied from interface:PhiMake a copy, leaving it at the same parent.
-
hasRho
public boolean hasRho()
Description copied from interface:PhiReturns true if object has bound rho attribute.
-
take
public Phi take(String name)
Description copied from interface:PhiTake object by name of the attribute.
-
take
public Phi take(int pos)
Description copied from interface:PhiTake object by position of the attribute.
-
put
public void put(int pos, Phi obj)Description copied from interface:PhiPut object by position of the attribute.
-
put
public void put(String name, Phi obj)
Description copied from interface:PhiPut object by name of the attribute.
-
-