Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
knewbie committed Apr 17, 2017
1 parent 45a79f8 commit 6045725
Show file tree
Hide file tree
Showing 9 changed files with 138 additions and 139 deletions.
62 changes: 31 additions & 31 deletions Dict.ts
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@

export class Dict<T>{
private data: any;
private num:number;

constructor() {
this.data = {};
this.num = 0;
}
private data: any;
private num: number;

public add(key: string, val: T) {
this.data[key] = val;
this.num++;
}
constructor() {
this.data = {};
this.num = 0;
}

public find(key: string): T {
return this.data[key];
}
public add(key: string, val: T) {
this.data[key] = val;
this.num++;
}

public remove(key: string) {
delete this.data[key];
this.num--;
}
public find(key: string): T {
return this.data[key];
}ßßß

public clear() {
for (let k in this.data) {
delete this.data[k];
}
this.num = 0;
}
public remove(key: string) {
delete this.data[key];
this.num--;
}

public count(): number {
return Object.keys(this.data).length;
public clear() {
for (let k in this.data) {
delete this.data[k];
}
this.num = 0;
}

public count(): number {
return Object.keys(this.data).length;
}

public display() {
for(let k in this.data) {
console.log(k," => ", this.data[k]);
}
public display() {
for (let k in this.data) {
console.log(k, " => ", this.data[k]);
}
}
}
}
Loading

0 comments on commit 6045725

Please sign in to comment.