com.cmpware.cmp
Class MemoryAccessException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.cmpware.cmp.MemoryAccessException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
MemoryMappedIOException

public class MemoryAccessException
extends java.lang.Exception

This class implements the Memory Access Exception. This is thrown whenever an attempt is made to access an illegal memory address.

Copyright (c) 2004 Cmpware, Inc. All Rights Reserved.

Author:
SAG
See Also:
Serialized Form

Field Summary
protected  int addr
          The address access that caused the exception
static java.lang.String copyright
          Copyright string
protected  int data
          The data of the attempted to be read / write that caused the exception
protected  boolean isWrite
          Did a read or a write cause the exception?
(package private) static long serialVersionUID
           
 
Constructor Summary
MemoryAccessException()
          The constructor
MemoryAccessException(int addr)
          A constructor.
MemoryAccessException(int addr, int data)
          A constructor.
MemoryAccessException(java.lang.String msg)
          A constructor.
MemoryAccessException(java.lang.String msg, int addr)
          A constructor.
MemoryAccessException(java.lang.String msg, int addr, int data)
          A constructor.
 
Method Summary
 int getAddress()
          This method returns the memory address that caused the exception.
 int getData()
          This method returns the data that was attempted to be read / written when the exception occurred.
 boolean isWrite()
          This method returns true if the memory access which caused the exception was a write and a false if it was a read.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

copyright

public static final java.lang.String copyright
Copyright string

See Also:
Constant Field Values

addr

protected int addr
The address access that caused the exception


data

protected int data
The data of the attempted to be read / write that caused the exception


isWrite

protected boolean isWrite
Did a read or a write cause the exception?


serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

MemoryAccessException

public MemoryAccessException()
The constructor


MemoryAccessException

public MemoryAccessException(java.lang.String msg)
A constructor.

Parameters:
msg - The exception message string.

MemoryAccessException

public MemoryAccessException(java.lang.String msg,
                             int addr)
A constructor. This is used primarily for reads, where the data read may not be available.

Parameters:
msg - The exception message string.
addr - The address of the memory access which caused the exception.

MemoryAccessException

public MemoryAccessException(int addr)
A constructor. This is used primarily for reads, where the data read may not be available.

Parameters:
addr - The address of the memory access which caused the exception.

MemoryAccessException

public MemoryAccessException(java.lang.String msg,
                             int addr,
                             int data)
A constructor. This is used primarily for writes, where the data being written may be useful.

Parameters:
msg - The exception message string.
addr - The address of the memory access which caused the exception.
data - If the access is a write, this parameter contains the data attempted to be written when the exception occurred.

MemoryAccessException

public MemoryAccessException(int addr,
                             int data)
A constructor. This is used primarily for writes, where the data being written may be useful.

Parameters:
addr - The address of the memory access which caused the exception.
data - If the access is a write, this parameter contains the data attempted to be written when the exception occurred.
Method Detail

getAddress

public int getAddress()
This method returns the memory address that caused the exception.

Returns:
This method returns the memory address that caused the exception.

getData

public int getData()
This method returns the data that was attempted to be read / written when the exception occurred.

Returns:
This method returns the data that was attempted to be read / written when the exception occurred.

isWrite

public boolean isWrite()
This method returns true if the memory access which caused the exception was a write and a false if it was a read.

Returns:
This method returns true if the memory access which caused the exception was a write and a false if it was a read.