# Google Cloud Service Control V1 Client - Class LinearBuckets (2.2.0)

2.2.0 (latest) 2.1.1 2.0.4 1.4.4 1.3.0 1.2.1 1.1.1 1.0.6 Reference documentation and code samples for the Google Cloud Service Control V1 Client class LinearBuckets.

Describing buckets with constant width.

Generated from protobuf message `google.api.servicecontrol.v1.Distribution.LinearBuckets`

## Namespace

Google \\ Cloud \\ ServiceControl \\ V1 \\ Distribution

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ num_finite_buckets` | `int` The number of finite buckets. With the underflow and overflow buckets, the total number of buckets is `num_finite_buckets` + 2. See comments on `bucket_options` for details. |
| `↳ width` | `float` The i'th linear bucket covers the interval \[offset + (i-1) \* width, offset + i \* width) where i ranges from 1 to num_finite_buckets, inclusive. Must be strictly positive. |
| `↳ offset` | `float` The i'th linear bucket covers the interval \[offset + (i-1) \* width, offset + i \* width) where i ranges from 1 to num_finite_buckets, inclusive. |

### getNumFiniteBuckets

The number of finite buckets. With the underflow and overflow buckets,
the total number of buckets is `num_finite_buckets` + 2.

See comments on `bucket_options` for details.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### setNumFiniteBuckets

The number of finite buckets. With the underflow and overflow buckets,
the total number of buckets is `num_finite_buckets` + 2.

See comments on `bucket_options` for details.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getWidth

The i'th linear bucket covers the interval
\[offset + (i-1) \* width, offset + i \* width)
where i ranges from 1 to num_finite_buckets, inclusive.

Must be strictly positive.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `float` |   |

### setWidth

The i'th linear bucket covers the interval
\[offset + (i-1) \* width, offset + i \* width)
where i ranges from 1 to num_finite_buckets, inclusive.

Must be strictly positive.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `float` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getOffset

The i'th linear bucket covers the interval
\[offset + (i-1) \* width, offset + i \* width)
where i ranges from 1 to num_finite_buckets, inclusive.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `float` |   |

### setOffset

The i'th linear bucket covers the interval
\[offset + (i-1) \* width, offset + i \* width)
where i ranges from 1 to num_finite_buckets, inclusive.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `float` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |