{"size": 1110, "ext": "js", "max_stars_repo_path": "custom_modules/models/PathsModel.js", "max_stars_repo_name": "scanton/connectopus2", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "custom_modules/models/PathsModel.js", "max_issues_repo_name": "scanton/connectopus2", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "custom_modules/models/PathsModel.js", "max_forks_repo_name": "scanton/connectopus2", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 24.6666666667, "max_line_length": 90, "alphanum_fraction": 0.6756756757}
module.exports = class PathsModel extends AbstractModel {

	constructor() {
		super();
		this._paths = {};
		this._indexes = {}
		this._currentProject = null;
	}

	getPathData() {
		this._strip({currentPath: this._currentPath, paths: this._paths, root: this._root});
	}
	setCurrentProject(id) {
		this._currentProject = id;
		if(!this._paths[id]) {
			this._paths[id] = [];
		}
		if(!this._indexes[id]) {
			this._indexes[id] = 0;
		}
	}
	setPath(path) {
		this._paths[this._currentProject].push(path);
		++this._indexes[this._currentProject];
		dispatchEvent("path-change", this.getPathData());
	}
	previousPath() {
		if(this._indexes[_indexes[this._currentProject]] > 0) {
			--this._indexes[this._currentProject];
			dispatchEvent("path-change", this.getPathData());
		}
	}
	nextPath() {
		if(this._paths[this._currentProject].length - 1 > this._indexes[this._currentProject]) {
			++this._indexes[this._currentProject];
			dispatchEvent("path-change", this.getPathData());
		}
	}
	isAtBeginning() {
		return this._currentPath == 0;
	}
	isAtEnd() {
		return this._currentPath == this._paths.length - 1;
	}
}