Skip to main content
Version: v1

PaddingSegment Class

An empty segment that occupies 'cachedLength' positions. SparseMatrix uses PaddingSegment to "pad" a run of unoccupied cells.

This API is deprecated and will be removed in a future release.

PaddingSegment is part of an abandoned prototype. Use SharedMatrix instead.

Signature

export declare class PaddingSegment extends BaseSegment

Extends: BaseSegment

Constructors

Constructor Description
(constructor)(size) Constructs a new instance of the PaddingSegment class

Static Properties

Property Type Description
typeString

Static Methods

Method Return Type Description
fromJSONObject(spec) PaddingSegment
is(segment) segment is PaddingSegment

Properties

Property Type Description
type

Methods

Method Return Type Description
append(segment) void
canAppend(segment) boolean
clone(start, end) PaddingSegment
createSplitSegmentAt(pos) PaddingSegment
removeRange(start, end) boolean
toJSONObject() { pad: number; props: PropertySet; }
toString() string

Constructor Details

(constructor)

Constructs a new instance of the PaddingSegment class

Signature

constructor(size: number);

Parameters

Parameter Type Description
size number

Property Details

type

Signature

readonly type = "PaddingSegment";

typeString

Signature

static readonly typeString = "PaddingSegment";

Method Details

append

Signature

append(segment: ISegment): void;

Parameters

Parameter Type Description
segment ISegment

canAppend

Signature

canAppend(segment: ISegment): boolean;

Parameters

Parameter Type Description
segment ISegment

Returns

Return type: boolean

clone

Signature

clone(start?: number, end?: number): PaddingSegment;

Parameters

Parameter Modifiers Type Description
start optional number
end optional number

Returns

Return type: PaddingSegment

createSplitSegmentAt

Signature

protected createSplitSegmentAt(pos: number): PaddingSegment;

Parameters

Parameter Type Description
pos number

Returns

Return type: PaddingSegment

fromJSONObject

Signature

static fromJSONObject(spec: any): PaddingSegment;

Parameters

Parameter Type Description
spec any

Returns

Return type: PaddingSegment

is

Signature

static is(segment: ISegment): segment is PaddingSegment;

Parameters

Parameter Type Description
segment ISegment

Returns

Return type: segment is PaddingSegment

removeRange

Signature

removeRange(start: number, end: number): boolean;

Parameters

Parameter Type Description
start number
end number

Returns

Return type: boolean

toJSONObject

Signature

toJSONObject(): {
pad: number;
props: PropertySet;
};

Returns

Return type: { pad: number; props: PropertySet; }

toString

Signature

toString(): string;

Returns

Return type: string