954,523 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

help

hi

does anyone know what this mean?

SWT.error(SWT.ERROR_NULL_ARGUMENT);

is there another virsion of this to write?

sam1
Posting Whiz
300 posts since Nov 2004
Reputation Points: 10
Solved Threads: 1
 

This is done for error handling

Form ezample

* @exception IllegalArgumentException <ul>
 *    <li>ERROR_NULL_ARGUMENT - if the stream is null</li>
 * </ul>
 * @exception SWTException <ul>
 *    <li>ERROR_INVALID_IMAGE - if the image file contains invalid data</li>
 *    <li>ERROR_IO - if an input/output error occurs while reading data</li>
 * </ul>
 */
public ImageData[] load(InputStream stream) {
	if (stream == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
	reset();
	data = FileFormat.load(stream, this);
	return data;
}


If the stream is null.. etc etc..

It allows comparison..

techniner
Posting Pro
527 posts since May 2005
Reputation Points: 12
Solved Threads: 19
 

so if i had:

public boolean contains (Point pt) {
if (pt == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
return contains(pt.x, pt.y);
}

does it mean if pt == null then it is false else return contains.....?

sam1
Posting Whiz
300 posts since Nov 2004
Reputation Points: 10
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You