# Class SpinEvent

java.lang.Object
com.sparshui.common.messages.events.SpinEvent

All Implemented Interfaces:
  `Event, Serializable`

public class SpinEvent extends Object implements Event

See Also:
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`SpinEvent()`
`SpinEvent(byte[] data)`
Constructs a new SpinEvent from a serialized version - 4 bytes : rotationX - 4 bytes : rotationY - 4 bytes : rotationZ - 12 bytes total
`SpinEvent(float rotationX, float rotationY, float rotationZ)`

## Method Summary

Modifier and Type
Method
Description
`int`
`getEventType()`
Returns the integer value of this event type.
`float`
`getRotationX()`
`float`
`getRotationY()`
`float`
`getRotationZ()`
`byte[]`
`serialize()`
Constructs the data packet with this event data.
`void`
`setRotationX(float rotation)`
`void`
`setRotationY(float rotation)`
`void`
`setRotationZ(float rotation)`
`String`
`toString()`

### Methods inherited from class Object

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

## Constructor Details

### SpinEvent

public SpinEvent()

### SpinEvent

public SpinEvent(float rotationX, float rotationY, float rotationZ)

### SpinEvent

public SpinEvent(byte[] data)
Constructs a new SpinEvent from a serialized version - 4 bytes : rotationX - 4 bytes : rotationY - 4 bytes : rotationZ - 12 bytes total

Parameters:
  `data` - the serialized version of touchEvent

## Method Details

### getEventType

public int getEventType()
Description copied from interface: `Event`
Returns the integer value of this event type. Event type values are defined in the enumeration com.sparshui.common.messages.events.EventType.java

Specified by:
  `getEventType` in interface `Event`
Returns:
  The event type

### getRotationX

public float getRotationX()

### getRotationY

public float getRotationY()

### getRotationZ

public float getRotationZ()

### setRotationX

public void setRotationX(float rotation)

### setRotationY

public void setRotationY(float rotation)

### setRotationZ

public void setRotationZ(float rotation)

### serialize

public byte[] serialize()
Constructs the data packet with this event data. Message format for this event: - 4 bytes : event type - 4 bytes : rotationX - 4 bytes : rotationY - 4 bytes : rotationZ - 16 bytes total

Specified by:
  `serialize` in interface `Event`
Returns:
  serialized data

### toString

public String toString()

Overrides:
  `toString` in class `Object`