Skip to content

Commit

Permalink
docs: fixed interfaces and implemented classes
Browse files Browse the repository at this point in the history
made it so classes define and properly implement methods tey're supposed to for docs
  • Loading branch information
EddieCornelious committed May 19, 2018
1 parent 5ddae81 commit 084cd66
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/HashSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import SetInterface from './SetInterface.js';
/**
* HashSet representation
* @class
* @implements SetInterface
* @implements {SetInterface}
* @param {number} [initialCapacity=13] - The initial size of the hashset
*
* @example
Expand Down
7 changes: 4 additions & 3 deletions src/MultiMap.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import RBTree from "./RedBlackTree.js";

/**
* @implements MultiMapInterFace
* @extends RedBlackTree
* @class
* @implements {MultiMapInterface}
* @extends {RBTree}
*/
class MultiMap extends RBTree {
constructor(c) {
super(c);
}

puts(key, value) {
put(key, value) {
const v = super.getVal(key);
if (v) {
if (v.indexOf(value) === -1) {
Expand Down
3 changes: 2 additions & 1 deletion src/MultiMapInterface.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/**
* Maps one key to multiple values but does not contain duplicate kv pairs
* @extends MapInterface
*
* @interface
*
*/
class MultiMapInterface {
Expand Down
14 changes: 13 additions & 1 deletion src/Set.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import RBTree from './RedBlackTree.js';
/**
* Set representaion
* @class
* @implements SetInterface
* @implements {SetInterface}
* @param {function} comparator - @see Global#defaultComparator
*
* @example
Expand Down Expand Up @@ -45,6 +45,18 @@ class Set extends SetInterface {
max() {
return this.map.max();
}

union(thatSet){
return super.union(thatSet);
}

intersect(thatSet){
return super.intersect(thatSet);
}

diff(thatSet){
return super.diff(thatSet);
}
}

export default Set;
4 changes: 3 additions & 1 deletion src/SetInterface.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/**
* Set Interface
* Collection of elements that contain no duplicates
*
* @interface
*
*/
class SetInterface {
constructor() {}
Expand Down

0 comments on commit 084cd66

Please sign in to comment.