Home Reference Source
public class | source

PartialView

Extends:

Map → PartialView

Member Summary

Public Members
public get

Get the least frequent peer.

public get

Get the oldest peer in the partial view.

Method Summary

Public Methods
public

add(peerId: string)

Add the peer to the partial view with an age of 0.

public

Increment the age of the whole partial view

public

removeAll(peerId: string): number

Remove all entries of the peer from the partial view.

public

removeOldest(peerId: string)

Remove the oldest entry of the peer from the partial view.

public

Remove the newest entry of the peer from the partial view.

Public Members

public get leastFrequent: string: * source

Get the least frequent peer. If multiple peers have the same number of occurrences, it chooses one among them at random.

Return:

string

The identifier of a least frequent peer.

public get oldest: string: * source

Get the oldest peer in the partial view.

Return:

string

The oldest peer in the array.

Public Methods

public add(peerId: string) source

Add the peer to the partial view with an age of 0.

Params:

NameTypeAttributeDescription
peerId string

The identifier of the peer added to the partial view.

public increment() source

Increment the age of the whole partial view

public removeAll(peerId: string): number source

Remove all entries of the peer from the partial view.

Params:

NameTypeAttributeDescription
peerId string

The identifier of the peer to remove from the partial view.

Return:

number

The number of occurrences of peerId removed.

public removeOldest(peerId: string) source

Remove the oldest entry of the peer from the partial view.

Params:

NameTypeAttributeDescription
peerId string

The identifier of the peer to remove from the partial view.

public removeYoungest(peerId: string) source

Remove the newest entry of the peer from the partial view.

Params:

NameTypeAttributeDescription
peerId string

The identifier of the peer to remove from the partial view.