Package org.eolang
Class Data.ToPhi
java.lang.Object
org.eolang.Data.ToPhi
- Enclosing interface:
- Data
Makes a
Phi out of a primitive Java object, like String or Integer.
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 -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()Make a copy, leaving it at the same parent.Copy self object.byte[]delta()Take the data.booleanforma()Get forma of the phi.inthashCode()booleanhasRho()Returns true if object has bound rho attribute.locator()Get code locator of the phi.voidPut object by position of the attribute.voidPut object by name of the attribute.take(int pos) Take object by position of the attribute.Take object by name of the attribute.
-
Constructor Details
-
ToPhi
Ctor.- Parameters:
obj- Data
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
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
Description copied from interface:PhiTake object by name of the attribute. -
take
Description copied from interface:PhiTake object by position of the attribute. -
put
Description copied from interface:PhiPut object by position of the attribute. -
put
Description copied from interface:PhiPut object by name of the attribute. -
locator
Description copied from interface:PhiGet code locator of the phi. -
forma
Description copied from interface:PhiGet forma of the phi. -
copy
Description copied from interface:PhiCopy self object. -
delta
public byte[] delta()Description copied from interface:DataTake the data.
-