joeq.Allocator
Class CodeAllocator.InstructionPointer

java.lang.Object
  extended by joeq.Allocator.CodeAllocator.InstructionPointer
All Implemented Interfaces:
Comparable
Enclosing class:
CodeAllocator

public static class CodeAllocator.InstructionPointer
extends Object
implements Comparable

An object of this class represents a code address. It can be compared with a jq_CompiledCode object with compareTo and equals. They are equal if the InstructionPointer points within the range of the compiled code; the InstructionPointer is less if it is before the start address of the compiled code; the InstructionPointer is less if it is after the end address of the compiled code.


Field Summary
static jq_InstanceField _ip
           
 
Constructor Summary
CodeAllocator.InstructionPointer(CodeAddress ip)
          Create a new instruction pointer.
 
Method Summary
 int compareTo(CodeAllocator.InstructionPointer that)
          Compare this instruction pointer to another instruction pointer.
 int compareTo(jq_CompiledCode that)
          Compare this instruction pointer to a compiled code object.
 int compareTo(Object that)
          Compares this instruction pointer to the given object (InstructionPointer or jq_CompiledCode)
 boolean equals(CodeAllocator.InstructionPointer that)
          Returns true if this instruction pointer refers to the same location as the given instruction pointer, false otherwise.
 boolean equals(jq_CompiledCode that)
          Returns true if this instruction pointer refers to a location within the given compiled code, false otherwise.
 boolean equals(Object that)
          Compares this instruction pointer with the given object (InstructionPointer or jq_CompiledCode).
 CodeAddress getIP()
          Extract the address of this instruction pointer.
 int hashCode()
          Returns the hash code of this instruction pointer.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_ip

public static final jq_InstanceField _ip
Constructor Detail

CodeAllocator.InstructionPointer

public CodeAllocator.InstructionPointer(CodeAddress ip)
Create a new instruction pointer.

Parameters:
ip - instruction pointer value
Method Detail

getIP

public CodeAddress getIP()
Extract the address of this instruction pointer.

Returns:
address of this instruction pointer

compareTo

public int compareTo(jq_CompiledCode that)
Compare this instruction pointer to a compiled code object.

Parameters:
that - compiled code to compare against
Returns:
-1 if this ip comes before the given code, 0 if it is inside the given code, 1 if it is after the given code

compareTo

public int compareTo(CodeAllocator.InstructionPointer that)
Compare this instruction pointer to another instruction pointer.

Parameters:
that - instruction pointer to compare against
Returns:
-1 if this ip is before the given ip, 0 if it is equal to the given ip, 1 if it is after the given ip

compareTo

public int compareTo(Object that)
Compares this instruction pointer to the given object (InstructionPointer or jq_CompiledCode)

Specified by:
compareTo in interface Comparable
Parameters:
that - object to compare to
Returns:
-1 if this is less than, 0 if this is equal, 1 if this is greater than

equals

public boolean equals(jq_CompiledCode that)
Returns true if this instruction pointer refers to a location within the given compiled code, false otherwise.

Parameters:
that - compiled code to compare to
Returns:
true if the instruction pointer is within, false otherwise

equals

public boolean equals(CodeAllocator.InstructionPointer that)
Returns true if this instruction pointer refers to the same location as the given instruction pointer, false otherwise.

Parameters:
that - instruction pointer to compare to
Returns:
true if the instruction pointers are equal, false otherwise

equals

public boolean equals(Object that)
Compares this instruction pointer with the given object (InstructionPointer or jq_CompiledCode).

Overrides:
equals in class Object
Parameters:
that - object to compare with
Returns:
true if these objects are equal, false otherwise

hashCode

public int hashCode()
Returns the hash code of this instruction pointer. This is a really bad implementation (just returns 0), and should not be counted on.

Overrides:
hashCode in class Object
Returns:
hash code


Copyright © 2001-2005 John Whaley. All Rights Reserved.