TS Class Diagram - GitHub

TS Class Diagram

1. TypeScript-STL 2. Collection 3. Library 4. Protocol 5. Templates 6. Examples

TypeScript-STL

TypeScript-STL (Standard Template Library)

Basics Linear Containers

Set Containers Map Containers

T

IContainer

template

+assign(first: XIterator, last: XIterator) +clear() +begin() -> Iterator +end() -> Iterator +rbegin() -> ReverseIterator +rend() -> ReverseIterator +size() -> number +empty() -> boolean +push(...: U[]) -> number +insert(Iterator, T) -> Iterator +erase(Iterator) -> Iterator

template

+erase(Iterator, Iterator) -> Iterator +swp(IContainer)

11

0N

T

Iterator

#source: IContainer +consturctor(IContainer) +prev(): Iterator +next(): Iterator +advance(size_t): Iterator +get value() -> T +equal_to(Iterator) -> boolean +swap(Iterator)

11

T

Container

implements IContainer

+ cons truct or() +cons truct or(C ontai ner) +constructor(Iterator, Iterator) +clear()

Linear Containers

Linear Containers - Vector - Deque - List

FIFO & LIFO Containers - Queue - Stack

Container extends IContainer

ReverseIterator

extends Container::Iterator

#base_: Container::iterator +cons truct or(C ontai ner::iterat or) #create_neighbor() -> ReverseIterator +base() -> Container::iterator +prev() -> ReverseIterator +next() -> ReverseIterator +advance(size_t) -> ReverseIterator +get value() -> Container::value_type +equal_to(ReverseIterator) -> boolean +swap(ReverseIterator)

11

Hashed & Tree-structured Containers

Hashed Containers - HashSet - HasMap - HashMultiSet - HashMultiMap

Tree-structured Containers - TreeSet - TreeMap - TreeMultiSet - TreeMultiMap

PriorityQueue

T

Stack

#container_: ILinearContainer +Stack() +Stack(Stack) +top() -> T +size() -> size_t +empty() -> boolean +push(T) +pop()

11

11

T

ILinearContainer

extends IContainer

+using super::assign +assign(n: size_t, val: T) +front(): T +back(): T + pus h_ back(T ) +pop_back() +using super::insert +insert(Iterator, size_t, T) -> Iterator

template

+ insert(Iterator, XIterator, XIterator) -> Iterator

T

Stack

#container_: ILinearContainer +Stack() +Stack(Stack) +front() -> T +back() -> T +size() -> size_t +empty() -> boolean +push(T) +pop()

11

11

T

IDequeContainer

extends ILinearContainer

+push_front(T) +pop_front()

T

IArrayContainer

extends ILinearContainer

+reserve(size_t) +capacity() -> size_t +at(size_t) -> T +set(size_t, T)

T

List

extends Container

implements IDequeContainer

#begin_: ListIterator

#end_: ListIterator

#size_: size_t

1

+override super::constructor

1

+constructor(size_t, T)

+override super::assign

+clear()

+push(...: U[]): size_t +override super::insert +override super::erase

+{ methods}

T

ListIterator

extends Iterator

#prev_: ListIterator

#next_: ListIterator

#value_: T

2

1

+constructor

N

(List, ListIterator, ListIterator, T) 1

+prev() -> ListIterator

+next() -> ListIterator

+advance(size_t) -> ListIterator

+get value(): T +set value(T) +equal_to(ListIterator) -> boolean

+swap(ListIterator)

T

ListReverseIterator

extends ReverseIterator

1

1 +constructor(ListIterator) #create_neighbor() -> ListReverseIterator +set value(T)

T

Deque

extends Container implements IArrayContainer,

ID eque Conta ine r< T>

#matrx_: T[][] #size_: size_t #capacity_: size_t

+override super::constructor

1

+constructor(size_t, T)

+override super::assign

1

+clear()

+reserve(size_t)

+push(...: U[]): size_t +at(size_t) -> T +set(size_t, T)

+override super::insert +override super::erase -fe tch_i ndex(siz e_ t)

-> Pair

T

DequeIterator

extends Iterator

implements IArrayIterator

#index_: size_t

0 +constructor(Deque, size_t)

1

+prev() -> DequeIterator

N +next() -> DequeIterator

1

+advance(size_t) -> DequeIterator

+get index(): size_t +get value(): T +set value(T) +equal_to(DequeIterator) -> boolean

+swap(DequeIterator)

T

DequeReverseIterator

extends ReverseIterator implements IArrayIterator

1

1 +constructor(DequeIterator) #create_neighbor() -> DequeReverseIterator +get index() -> size_t +set value(T)

T

Vector

extends Array

implements IArrayContainer

1

+override super::constructor +constructor(size_t, T)

1

+override super::assign

+clear()

+override super::insert +override super::erase

T

VectorIterator

extends Iterator

#index_: size_t

0 +constructor(Vector, size_t)

1

+prev() -> VectorIterator

N +next() -> VectorIterator

1

+advance(size_t) -> VectorIterator

+getindex(): size_t +get value(): T +set value(T) +equal_to(VectorIterator) -> boolean

+swap(VectorIterator)

T

VectorReverseIterator

extends ReverseIterator implements IReverseIterator

0

1 +constructor(VectorIterator) #create_neighbor() -> VectorReverseIterator +get index() -> size_t +set value(T)

T

SetContainer

extends Container

#data_: List

+ cons truct or() +constructor(Array) + cons truct or(I Conta ine r< T> )

template

+constructor(InputIterator, InputIterator) +assign(InputIterator, InputIterator) #init() +clear()

+find(T) -> SetIterator +begin() -> SetIterator +end() -> SetIterator +rbegin() -> ReverseSetIterator +rend() -> ReverseSetIterator +count(T) -> size_t +has(T) -> boolean +size() -> size_t

+push(Pair[]): size_t +insert(SetIterator, T) -> SetIterator

template

+insert(InputIterator, InputIterator) +erase(T) -> size_t

template

+erase(XIterator, XIterator)

template

#handle_insert(XIterator, XIterator) #handle_erase(XIterator, XIterator)

11

T

UniqueSet

extends SetContainer< T>

+using super::constructor +count(Key) -> size_t +using super::insert +insert(T) -> Pair +swap(UniqueSet)

T

MultiSet

extends SetContainer

+using super::constructor +using super::insert +insert(T) -> SetIterator +swap(MultiSet)

0N

T

SetIterator

extends Iterator

#list_it_: ListIterator

+constructor(SetContainer, ListIterator)

+prev() -> SetIterator

1

+next() -> SetIterator

+advance(size_t) -> SetIterator

1

+get value() -> Pair +get first() -> Key +get second() -> T +set second(T)

+equal_to(Set_Iterator) -> boolean +less(SetIterator) -> boolean +hash() -> size_t

T

SetReverseIterator

extends ReverseIterator

1

1

+cons truct or(S et It erat or) #create_reverse_iterator()

-> SetReverseIterator

T

HashSet

extends SpecifiedSet

#hash_buckets_: SetHashBuckets

+using super::constructor

#init()

template

+assign(InputIterator, InputIterator)

1

+clear()

+find(T) -> SetIterator

+override super::push +override super::insert

template

#handle_insert(XIterator, XIterator) #handle_erase(XIterator, XIterator(

T

MapHashBuckets

extends HashBuckets

1

1

-set_: SetContainer< T>

+ cons truct or(S et Conta iner< T> ) +find(T) -> SetIterator

T

HashBuckets

#buckets_: Array #item_size_: size_t

+constructor() +reserve(size_t) +clear() +at(size_t) -> Array -hash_index(T) -> size_t +insert(T) +erase(T)

T

Tree(Multi)Set

extends SpecifiedSet

#tree_: PairTree

+using super::constructor #init()

template

+assign(InputIterator, InputIterator) +clear() +find(T) -> SetIterator +lower_bound(T) -> SetIterator +upper_bound(T) -> SetIterator +equal_range(T)

-> Pair +override super::insert

template

#handle_insert(XIterator, XIterator) #handle_erase(XIterator, XIterator(

11

11

T

PriorityQueue

extends TreeMultiSet

#container_: TreeMultiSet

+constructor() + cons truct or(T []) + cons truct or(I Conta ine r< T> ) +constructor(Iterator, Iterator) +top() -> T +size() -> size_t +empty() -> boolean +push(T) +pop()

T

AtomicTree

extends XTree

-compare_: (Key, Key) => boolean

+public constructor(Compare = std.less) +using super::find +find(SetIterator) -> XTreeNode

template

+is_less(XIterator, XIterator) -> boolean +is_equal_to(XIterator, XIterator)

-> boolean

T

XTree

#root_: XTreeNode

+public constructor() +find(T) -> XTreeNode #fetch_maximum(XTreeNode)

-> XTreeNode -fetch_color(XTreeNode) -> Color +insert(T) +erase(T) -insert_case_{1~5}(XTreeNode) -erase_case_{1~6}(XTreeNode) #rotate_left(XTreeNode) #rotate_right(XTreeNode) #replace_node(XTreeNode, XTreeNode) +is_less(T, T) -> boolean +is_equal_to(T, T) -> boolean

11

0N

XTreeNode

parent_: XTreeNode left_: XTreeNode right_: XTreeNode value: T color: Color +constructor(T, Color)

02

T

1 1

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download