com.google.zxing.common
Class ByteMatrix

java.lang.Object
  extended by com.google.zxing.common.ByteMatrix

public final class ByteMatrix
extends Object

A class which wraps a 2D array of bytes. The default usage is signed. If you want to use it as a unsigned container, it's up to you to do byteValue & 0xff at each location. JAVAPORT: The original code was a 2D array of ints, but since it only ever gets assigned -1, 0, and 1, I'm going to use less memory and go with bytes.

Since:
BlackBerry API 6.0.0

Constructor Summary
ByteMatrix(int width, int height)
           
 
Method Summary
 void clear(byte value)
           
 byte get(int x, int y)
           
 byte[][] getArray()
           
 int getHeight()
           
 int getWidth()
           
 void set(int x, int y, byte value)
           
 void set(int x, int y, int value)
           
 String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 



Constructor Detail

ByteMatrix

public ByteMatrix(int width,
                  int height)
Since:
BlackBerry API 6.0.0


Method Detail

getHeight

public int getHeight()
Since:
BlackBerry API 6.0.0

getWidth

public int getWidth()
Since:
BlackBerry API 6.0.0

get

public byte get(int x,
                int y)
Since:
BlackBerry API 6.0.0

getArray

public byte[][] getArray()
Since:
BlackBerry API 6.0.0

set

public void set(int x,
                int y,
                byte value)
Since:
BlackBerry API 6.0.0

set

public void set(int x,
                int y,
                int value)
Since:
BlackBerry API 6.0.0

clear

public void clear(byte value)
Since:
BlackBerry API 6.0.0

toString

public String toString()
Description copied from class: Object
Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Overrides:
toString in class Object
Returns:
a string representation of the object.
Since:
BlackBerry API 6.0.0





Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.