File size: 1,654 Bytes
c02f046
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/**
 * @class
 */
sahagin.CodeLine = function() {

  /**
   * line start from 1
   * @private
   * @type {number}
   */
  this.startLine = 0;

  /**
   * @private
   * @type {number}
   */
  this.endLine = 0;

  /**
   * @private
   * @type {sahagin.Code}
   */
  this.code = null;
};

/**
 * @returns {number}
 */
sahagin.CodeLine.prototype.getStartLine = function() {
  return this.startLine;
};

/**
 * @param {number} startLine
 */
sahagin.CodeLine.prototype.setStartLine = function(startLine) {
  this.startLine = startLine;
};


/**
 * @returns {number}
 */
sahagin.CodeLine.prototype.getEndLine = function() {
  return this.endLine;
};

/**
 * @param {number} endLine
 */
sahagin.CodeLine.prototype.setEndLine = function(endLine) {
  this.endLine = endLine;
};

/**
 * @returns {sahagin.Code}
 */
sahagin.CodeLine.prototype.getCode = function() {
  return this.code;
};

/**
 * @param {sahagin.Code} code
 */
sahagin.CodeLine.prototype.setCode = function(code) {
  this.code = code;
};

/**
 * @returns {Object.<String, *>}
 */
sahagin.CodeLine.prototype.toYamlObject = function() {
  var result = new Object();
  result['tartLine'] = this.startLine;
  result['endLine'] = this.endLine;
  result['code'] = sahagin.YamlUtils.toYamlObject(this.code);
  return result;
};

/**
 * @param {Object.<String, *>} yamlObject
 */
sahagin.CodeLine.prototype.fromYamlObject = function(yamlObject) {
  this.startLine = sahagin.YamlUtils.getIntValue(yamlObject, 'startLine');
  this.endLine = sahagin.YamlUtils.getIntValue(yamlObject, 'endLine');
  this.code = sahagin.Code.newInstanceFromYamlObject(sahagin.YamlUtils.getYamlObjectValue(yamlObject, 'code'));
};