Skip to content

Commit

Permalink
objectionary#2863 rollback to current master
Browse files Browse the repository at this point in the history
  • Loading branch information
c71n93 committed Apr 15, 2024
1 parent 76f06cd commit 725d9b1
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 9 deletions.
19 changes: 17 additions & 2 deletions eo-runtime/src/main/java/org/eolang/PhLocated.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@
* @since 0.21
*/
@Versionized
public final class PhLocated extends PhDecorator {
public final class PhLocated implements Phi {

/**
* The original.
*/
private final Phi origin;

/**
* The line number.
Expand Down Expand Up @@ -68,12 +73,22 @@ public PhLocated(final Phi phi, final int lne, final int pos) {
* @checkstyle ParameterNumberCheck (5 lines)
*/
public PhLocated(final Phi phi, final int lne, final int pos, final String loc) {
super(phi);
this.origin = phi;
this.line = lne;
this.position = pos;
this.location = loc;
}

@Override
public boolean equals(final Object obj) {
return this.origin.equals(obj);
}

@Override
public int hashCode() {
return this.origin.hashCode();
}

@Override
public String toString() {
return String.format(
Expand Down
19 changes: 17 additions & 2 deletions eo-runtime/src/main/java/org/eolang/PhLogged.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,19 @@
* @since 0.24
*/
@Versionized
public final class PhLogged extends PhDecorator {
public final class PhLogged implements Phi {

/**
* The origin being turned into a const.
*/
private final Phi origin;

/**
* Ctor.
* @param phi The origin
*/
public PhLogged(final Phi phi) {
super(phi);
this.origin = phi;
}

@Override
Expand Down Expand Up @@ -91,6 +96,16 @@ public String forma() {
return this.origin.forma();
}

@Override
public boolean equals(final Object obj) {
return this.origin.equals(obj);
}

@Override
public int hashCode() {
return this.origin.hashCode();
}

@Override
public String toString() {
return this.origin.toString();
Expand Down
21 changes: 18 additions & 3 deletions eo-runtime/src/main/java/org/eolang/PhNamed.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@
* @since 0.17
*/
@Versionized
final class PhNamed extends PhDecorator {
final class PhNamed implements Phi {

/**
* The original.
*/
private final Phi origin;

/**
* The name.
Expand All @@ -44,10 +49,20 @@ final class PhNamed extends PhDecorator {
* @param txt The name
*/
PhNamed(final Phi phi, final String txt) {
super(phi);
this.origin = phi;
this.name = txt;
}

@Override
public boolean equals(final Object obj) {
return this.origin.equals(obj);
}

@Override
public int hashCode() {
return this.origin.hashCode();
}

@Override
public String toString() {
return String.format("%s≡%s", this.name, this.origin.toString());
Expand Down Expand Up @@ -97,4 +112,4 @@ public void attach(final byte[] data) {
public byte[] delta() {
return this.origin.delta();
}
}
}
20 changes: 18 additions & 2 deletions eo-runtime/src/main/java/org/eolang/PhSafe.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,29 @@
* @since 0.26
*/
@Versionized
public final class PhSafe extends PhDecorator {
public final class PhSafe implements Phi {

/**
* The original.
*/
private final Phi origin;

/**
* Ctor.
* @param phi The object
*/
public PhSafe(final Phi phi) {
super(phi);
this.origin = phi;
}

@Override
public boolean equals(final Object obj) {
return this.origin.equals(obj);
}

@Override
public int hashCode() {
return this.origin.hashCode();
}

@Override
Expand Down

0 comments on commit 725d9b1

Please sign in to comment.