Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A method returns a value of type int what does it represent

Status
Not open for further replies.

Chrissirhc

Programmer
May 20, 2000
926
GB
Me again there is a method in class Raster or WriteableRaster
Its called getTransferType it returns an integer which is meant to describe what kind of data buffer field is being used. (By the way what is the field in the API?). Anyway
Field Summary
protected int banks
The number of banks in this DataBuffer.
protected int dataType
The data type of this DataBuffer.
protected int offset
Offset into default (first) bank from which to get the first element.
protected int[] offsets
Offsets into all banks.
protected int size
Usable size of all banks.
static int TYPE_BYTE
Tag for unsigned byte data.
static int TYPE_DOUBLE
Tag for double data.
static int TYPE_FLOAT
Tag for float data.
static int TYPE_INT
Tag for int data.
static int TYPE_SHORT
Tag for signed short data.
static int TYPE_UNDEFINED
Tag for undefined data
static int TYPE_USHORT
Tag for unsigned short data.
How do I know which TYPE_... it is depending on what integer is returned by the method. For instance if I got 4 would that mean it was TYPE_INT ??

Thanks if anyone can help
 
static int's are a way of having names values. As you have seen getTransferType returns an int. Inside DataBuffer there will be some code saying something like

static final int TYPE_BYTE = 0;
static final int TYPE_DOUBLE = 1;
etc.

this tells you what your int value means...

try printing out the values of DataBuffer.TYPE_BYTE, etc. you can refer to them by class name.variable name like this as they are static (i.e. they are a constant value contained in a class and are don't change in instances). My Home -->
 
Thanks alot that makes sense. I will try what you have said. I take it these are not private.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top