# Class Status

java.lang.Object
mpi.Status

public final class Status extends Object
This class represents `MPI_Status`.

## Field Summary

Fields
Modifier and Type
Field
Description
`protected final long[]`
`data`

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`Status()`
Status objects must be created only by the MPI methods.

## Method Summary

Modifier and Type
Method
Description
`int`
`getCount(Datatype datatype)`
Returns the number of received entries.
`int`
`getElements(Datatype datatype)`
Retrieves the number of basic elements from status.
`Count`
`getElementsX(Datatype datatype)`
Retrieves the number of basic elements from status.
`int`
`getError()`
Returns the `MPI_ERROR` of message.
`int`
`getIndex()`
Returns the index of message.
`int`
`getSource()`
Returns the "source" of message.
`int`
`getTag()`
Returns the "tag" of message.
`boolean`
`isCancelled()`
Tests if the communication was cancelled.
`void`
`setCancelled(boolean flag)`
Sets the cancelled flag.
`void`
`setElements(Datatype datatype, int count)`
Sets the number of basic elements for this status object.
`void`
`setElementsX(Datatype datatype, Count count)`
Sets the number of basic elements for this status object.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### data

protected final long[] data

## Constructor Details

### Status

protected Status()
Status objects must be created only by the MPI methods.

## Method Details

### getCount

public int getCount(Datatype datatype) throws MPIException
Returns the number of received entries.

Java binding of the MPI operation `MPI_GET_COUNT`.

Parameters:
  `datatype` - datatype of each item in receive buffer
Returns:
  number of received entries
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### isCancelled

public boolean isCancelled() throws MPIException
Tests if the communication was cancelled.

Java binding of the MPI operation `MPI_TEST_CANCELLED`.

Returns:
  true if the operation was successfully cancelled, false otherwise
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### getElements

public int getElements(Datatype datatype) throws MPIException
Retrieves the number of basic elements from status.

Java binding of the MPI operation `MPI_GET_ELEMENTS`.

Parameters:
  `datatype` - datatype used by receive operation
Returns:
  number of received basic elements
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### getElementsX

public Count getElementsX(Datatype datatype) throws MPIException
Retrieves the number of basic elements from status.

Java binding of the MPI operation `MPI_GET_ELEMENTS_X`.

Parameters:
  `datatype` - datatype used by receive operation
Returns:
  number of received basic elements
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### setElements

public void setElements(Datatype datatype, int count) throws MPIException
Sets the number of basic elements for this status object.

Java binding of the MPI operation `MPI_STATUS_SET_ELEMENTS`.

Parameters:
  `datatype` - datatype used by receive operation
  `count` - number of elements to associate with the status
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### setElementsX

public void setElementsX(Datatype datatype, Count count) throws MPIException
Sets the number of basic elements for this status object.

Java binding of the MPI operation `MPI_STATUS_SET_ELEMENTS_X`.

Parameters:
  `datatype` - datatype used by receive operation
  `count` - number of elements to associate with the status
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### setCancelled

public void setCancelled(boolean flag) throws MPIException
Sets the cancelled flag.

Java binding of the MPI operation `MPI_STATUS_SET_CANCELLED`.

Parameters:
  `flag` - if true indicates request was cancelled
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### getSource

public int getSource()
Returns the "source" of message.

Java binding of the MPI value `MPI_SOURCE`.

Returns:
  source of message

### getTag

public int getTag()
Returns the "tag" of message.

Java binding of the MPI value `MPI_TAG`.

Returns:
  tag of message

### getError

public int getError()
Returns the `MPI_ERROR` of message.

Returns:
  error of message.

### getIndex

public int getIndex()
Returns the index of message.

Returns:
  index of message.