cz.cuni.amis.pogamut.sposh.dbg.engine
Class EngineThread

Package class diagram package EngineThread
java.lang.Object
  extended by cz.cuni.amis.pogamut.sposh.dbg.engine.EngineThread
All Implemented Interfaces:
Comparable<EngineThread>, Comparator<EngineThread>

public class EngineThread
extends Object
implements Comparable<EngineThread>, Comparator<EngineThread>

This is a useful wrapper class for JPDAThread that makes dealing with a logic thread of a posh bot much easier.

Author:
HonzaH

Constructor Summary
EngineThread(org.netbeans.api.debugger.jpda.JPDADebugger debugger, org.netbeans.api.debugger.jpda.JPDAThread engineThread)
          Create new engine thread container.
 
Method Summary
 int compare(EngineThread o1, EngineThread o2)
           
 int compareTo(EngineThread other)
          Compare threads using their names.
 boolean equals(Object obj)
           
 org.netbeans.api.debugger.jpda.JPDADebugger getDebugger()
          Debugger from which we got the engine thread.
 String getName()
          Get name of the engine running in this thread.
 org.netbeans.api.debugger.jpda.This getThisVariable()
           
 org.netbeans.api.debugger.jpda.JPDAThread getThread()
          Get actuall debug thread the engine is using.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EngineThread

public EngineThread(org.netbeans.api.debugger.jpda.JPDADebugger debugger,
                    org.netbeans.api.debugger.jpda.JPDAThread engineThread)
Create new engine thread container.

Parameters:
debugger - debugger the thread belongs to
engineThread - thread the engine is using to evalute the plan.
Method Detail

getThread

public final org.netbeans.api.debugger.jpda.JPDAThread getThread()
Get actuall debug thread the engine is using.

Returns:
thread posh engine is using.

getDebugger

public final org.netbeans.api.debugger.jpda.JPDADebugger getDebugger()
Debugger from which we got the engine thread.

Returns:
debugger of the engine thread

getName

public final String getName()
Get name of the engine running in this thread. Name should be unique to one session. Name is derived from the name of the JPDAThread without suffix.

Returns:
Name of the engine thread.

getThisVariable

public org.netbeans.api.debugger.jpda.This getThisVariable()
                                                    throws com.sun.jdi.AbsentInformationException
Returns:
this variable of the JPDA thread.
Throws:
com.sun.jdi.AbsentInformationException

equals

public boolean equals(Object obj)
Specified by:
equals in interface Comparator<EngineThread>
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

compareTo

public int compareTo(EngineThread other)
Compare threads using their names.

Specified by:
compareTo in interface Comparable<EngineThread>
Parameters:
other - Thread to compare to
Returns:
-1, 0, 1 if name of this engine thread is less than, equals or greater than other.

compare

public int compare(EngineThread o1,
                   EngineThread o2)
Specified by:
compare in interface Comparator<EngineThread>


Copyright © 2013 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.