-
Notifications
You must be signed in to change notification settings - Fork 5
/
FacetTreeState.js
42 lines (33 loc) · 1.19 KB
/
FacetTreeState.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
var Class = require('../ext/Class');
var ListFilter = require('../service/ListFilter');
var HashMap = require('../util/collection/HashMap');
var HashSet = require('../util/collection/HashSet');
/**
* This class contains the core status about which nodes in a facet tree are
* expanded, which direction are they pointing, and which filters apply to them.
*/
var FacetTreeState = Class.create({
initialize: function(pathExpansions, pathToDirection, pathHeadToFilter) {
this.pathExpansions = pathExpansions || new HashSet();
this.pathToDirection = pathToDirection || new HashMap();
this.pathHeadToFilter = pathHeadToFilter || new HashMap();
/*
if(!pathToExpansion) {
this.pathToExpansion.put(null, true); //new FacetNodeState(true, false, new ListFilter()));
}
if(!pathToDirection) {
this.pathToDirection.put(null, 1);
}
*/
},
getPathExpansions: function() {
return this.pathExpansions;
},
getPathToDirection: function() {
return this.pathToDirection;
},
getPathHeadToFilter: function() {
return this.pathHeadToFilter;
}
});
module.exports = FacetTreeState;