-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblockcodechunk.go
executable file
·53 lines (44 loc) · 1.15 KB
/
blockcodechunk.go
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
package main
import (
"fmt"
)
// BlockCodeChunk denotes a block of code
type BlockCodeChunk struct {
Position int
Id string
Caption string //optional
Numbering string //optional Numbering before Caption
Value string
}
// String implements the Stringer interface
func (p BlockCodeChunk) String() string {
return fmt.Sprintf("BlockCodeChunk{Position: %d, Id: %v, Caption: %v, Value: %v}",
p.GetPosition(), p.Id, p.Caption, p.Value)
}
// GetPosition implements the Chunk interface
func (p *BlockCodeChunk) GetPosition() int {
return p.Position
}
// SetPosition implements the Chunk interface
func (p *BlockCodeChunk) SetPosition(pos int) {
p.Position = pos
}
// GetValue implements the Chunk interface
func (p *BlockCodeChunk) GetValue() string {
return p.Value
}
func (p *BlockCodeChunk) GetId() string {
return p.Id
}
func (p *BlockCodeChunk) GetCaption() string {
return p.Caption
}
func (p *BlockCodeChunk) SetCaption(c string) {
p.Caption = c
}
func (p *BlockCodeChunk) SetNumbering(c string) {
p.Numbering = c
}
func (p BlockCodeChunk) GetNumbering() string {
return p.Numbering
}