This method of the Command class retrieves a value that indicates for all applicable objects whether the state of the object is open or closed.
public int getState();
Returns an integer that indicates the object's state.