-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathHRemove.js
More file actions
65 lines (58 loc) · 1.29 KB
/
HRemove.js
File metadata and controls
65 lines (58 loc) · 1.29 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//
// Copyright (c) 2015, Shawn Jacobson
// Licensed under the Academic Free License version 3.0
//
// Ported from @see {@link https://bitbucket.org/brianfrank/haystack-java|Haystack Java Toolkit}
//
// History:
// 21 Mar 2015 Shawn Jacobson Creation
//
var HVal = require('./HVal');
/**
* HRemove is the singleton value used to indicate a tag remove.
* @see {@link http://project-haystack.org/doc/TagModel#tagKinds|Project Haystack}
*
* @constructor
* @extends {HVal}
*/
function HRemove() {
// ensure singleton usage
if (arguments.callee._singletonInstance) return arguments.callee._singletonInstance;
arguments.callee._singletonInstance = this;
}
HRemove.prototype = Object.create(HVal.prototype);
module.exports = HRemove;
/**
* Equals is based on reference
* @param {HRemove} that
* @return {boolean}
*/
HRemove.prototype.equals = function(that) {
return that instanceof HRemove && this === that;
};
/**
* Encode as "remove"
* @return {string}
*/
HRemove.prototype.toString = function() {
return "remove";
};
/**
* Encode as "R"
* @return {string}
*/
HRemove.prototype.toZinc = function() {
return "R";
};
/**
* Encode as "x:"
* @return {string}
*/
HRemove.prototype.toJSON = function() {
return "x:";
};
/**
* Singleton value
* @static
*/
HRemove.VAL = new HRemove();