# EventSequenceToken Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.providers.streams.common.eventsequencetoken/)

## CompareTo(StreamSequenceToken) {#compareto-orleans-streams-streamsequencetoken-c67f7e80}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.providers.streams.common.eventsequencetoken/methods/compareto-orleans-streams-streamsequencetoken-c67f7e80/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Streaming/Common/EventSequenceToken.cs#L88-L96)

```csharp
public override int CompareTo(StreamSequenceToken other)
```

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

### Parameters

- `other` (`StreamSequenceToken`): An object to compare with this instance.

### Returns

A value that indicates the relative order of the objects being compared. The return value has these meanings: 

| Value | Meaning |
| --- | --- |
| Less than zero | This instance precedes `other` in the sort order. |
| Zero | This instance occurs in the same position in the sort order as `other`. |
| Greater than zero | This instance follows `other` in the sort order. |

## CreateSequenceTokenForEvent(int) {#createsequencetokenforevent-int-d2cce81c}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.providers.streams.common.eventsequencetoken/methods/createsequencetokenforevent-int-d2cce81c/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Streaming/Common/EventSequenceToken.cs#L68)

```csharp
public EventSequenceToken CreateSequenceTokenForEvent(int eventInd)
```

Creates a sequence token for a specific event in the current batch.

### Parameters

- `eventInd` (`int`): The event index, for events which are part of a batch.

### Returns

The sequence token.

## Equals(StreamSequenceToken) {#equals-orleans-streams-streamsequencetoken-f602c190}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.providers.streams.common.eventsequencetoken/methods/equals-orleans-streams-streamsequencetoken-f602c190/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Streaming/Common/EventSequenceToken.cs#L80-L82)

```csharp
public override bool Equals(StreamSequenceToken other)
```

Indicates whether the current object is equal to another object of the same type.

### Parameters

- `other` (`StreamSequenceToken`): An object to compare with this object.

### Returns

`true` if the current object is equal to the `other` parameter; otherwise, `false`.

## Equals(object) {#equals-object-9bd0a880}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.providers.streams.common.eventsequencetoken/methods/equals-object-9bd0a880/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Streaming/Common/EventSequenceToken.cs#L74)

```csharp
public override bool Equals(object obj)
```

Determines whether the specified object is equal to the current object.

### Parameters

- `obj` (`object`): The object to compare with the current object.

### Returns

`true` if the specified object is equal to the current object; otherwise, `false`.

## GetHashCode {#gethashcode-84611f99}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.providers.streams.common.eventsequencetoken/methods/gethashcode-84611f99/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Streaming/Common/EventSequenceToken.cs#L100)

```csharp
public override int GetHashCode()
```

Serves as the default hash function.

### Returns

A hash code for the current object.

## ToString {#tostring-cb021e82}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.providers.streams.common.eventsequencetoken/methods/tostring-cb021e82/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Streaming/Common/EventSequenceToken.cs#L105)

```csharp
public override string ToString()
```

Returns a string that represents the current object.

### Returns

A string that represents the current object.
