new debugging tool ActorValueTracker

Former-commit-id: f30d2a859521082609425722edb91d3c366fbc58
Former-commit-id: 1486ad6b0a85415124c87522f07c012d4a335567
This commit is contained in:
Song Minjae
2016-12-29 20:06:37 +09:00
parent a6bbf256f0
commit 767802e75f
3 changed files with 252 additions and 3 deletions

View File

@@ -22,11 +22,11 @@ abstract class Actor : Comparable<Actor>, Runnable {
override fun equals(other: Any?) = referenceID == (other as Actor).referenceID
override fun hashCode() = referenceID
override fun toString() = "Actor, " +
override fun toString() =
if (actorValue.getAsString(AVKey.NAME).isNullOrEmpty())
"ID: ${hashCode()}"
"${hashCode()}"
else
"ID: ${hashCode()} (${actorValue.getAsString(AVKey.NAME)})"
"${hashCode()} (${actorValue.getAsString(AVKey.NAME)})"
override fun compareTo(other: Actor): Int = (this.referenceID - other.referenceID).sign()
fun Int.sign(): Int = if (this > 0) 1 else if (this < 0) -1 else 0