ts-collection
Version:
This is re-write of the java collection classes in typescript. There is some tweak as typescript templates are not as equivalent as Java.
31 lines (30 loc) • 922 B
TypeScript
import { Set } from "./set";
import { Collection } from "./collection";
export interface Map<K, V> {
size(): number;
isEmpty(): boolean;
containsKey(key: K): boolean;
containsValue(value: V): boolean;
get(key: K): V;
put(key: K, value: V): V;
remove(key: K): V;
putAll(m: Map<K, V>): void;
clear(): void;
keySet(): Set<K>;
values(): Collection<V>;
entrySet(): Set<MapEntry<K, V>>;
}
export declare function isMap<K, V>(param: any): param is Map<K, V>;
export interface MapEntry<K, V> {
getKey(): K;
getValue(): V;
setValue(value: V): V;
equals(obj: any): boolean;
}
export declare function isMapEntry<K, V>(param: any): param is MapEntry<K, V>;
export declare abstract class AbstractMapEntry<K, V> implements MapEntry<K, V> {
abstract getKey(): K;
abstract getValue(): V;
abstract setValue(value: V): V;
abstract equals(obj: any): boolean;
}