forked from NatLabRockies/nodehaystack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHMarker.js
More file actions
65 lines (58 loc) · 1.28 KB
/
HMarker.js
File metadata and controls
65 lines (58 loc) · 1.28 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');
/**
* HMarker is the singleton value for a marker tag.
* @see {@link http://project-haystack.org/doc/TagModel#tagKinds|Project Haystack}
*
* @constructor
* @extends {HVal}
*/
function HMarker() {
// ensure singleton usage
if (arguments.callee._singletonInstance) return arguments.callee._singletonInstance;
arguments.callee._singletonInstance = this;
}
HMarker.prototype = Object.create(HVal.prototype);
module.exports = HMarker;
/**
* Equals is based on reference
* @param {HMarker} that
* @return {boolean}
*/
HMarker.prototype.equals = function(that) {
return that instanceof HMarker && this === that;
};
/**
* Encode as "marker"
* @return {string}
*/
HMarker.prototype.toString = function() {
return "marker";
};
/**
* Encode as "M"
* @return {string}
*/
HMarker.prototype.toZinc = function() {
return "M";
};
/**
* Encode as "m:"
* @returns string
*/
HMarker.prototype.toJSON = function() {
return "m:";
};
/**
* Singleton value
* @static
*/
HMarker.VAL = new HMarker();