dot big bang

Developer API
Menu

Class StringSet

All
  • Public
  • Public/Protected
  • All

Hierarchy

  • StringSet

Index

Constructors

constructor

  • new StringSet(strings?: string[]): StringSet
  • Creates a new StringSet.

    Parameters

    • Optional strings: string[]

      The strings to populate the string set with.

    Returns StringSet

Methods

add

  • Adds the string s to this string set. If the string is already in the set, no change occurs.

    Parameters

    • s: String

      The string to add to the set.

    Returns StringSet

clone

  • Returns a new string set which is an exact copy of the given one.

    Returns StringSet

copy

  • Copies the strings in the given string set ss into this one.

    Parameters

    Returns StringSet

equals

  • Returns true if this set and the other one ss have exactly the same strings (no matter the order they store them internally).

    Parameters

    • ss: StringSet

      The other string set to compare this one to.

    Returns boolean

fromArray

  • Resets this string set to the strings provided in the array a. Strings appearing multiple times in the array will only appear once in this set.

    Parameters

    • a: string[]

      The string array to set this set from.

    Returns StringSet

has

  • has(s: String): boolean
  • Returns true if this string set contains the given string s.

    Parameters

    • s: String

      The string which presence in this set is to be tested.

    Returns boolean

intersect

  • Identify the strings that are common to both this set and the other string set ss and only keep those in this set. This operation potentially removes strings from this set but doesn't add any.

    Parameters

    • ss: StringSet

      The other string set to interect this one with.

    Returns StringSet

remove

  • Removes the string s from this string set. If the string wasn't in the set, no change occurs.

    Parameters

    • s: String

    Returns StringSet

toArray

  • toArray(): string[]
  • Returns an array of strings with all the strings in this set.

    Returns string[]