forked from extrame/xls
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cell.go
65 lines (53 loc) · 1.36 KB
/
cell.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
54
55
56
57
58
59
60
61
62
63
64
65
package xls
type cell struct {
contentHandler
}
// IsValid return true if the cell is valid
func (c cell) IsValid() bool {
return c.contentHandler != nil
}
// IsHyperLink return true if the cell is a hyperlink
func (c cell) IsHyperLink() bool {
_, ok := c.contentHandler.(*HyperLink)
return ok
}
// MustHpyerLink always return hyperlink
func (c cell) MustHpyerLink() *HyperLink {
return c.contentHandler.(*HyperLink)
}
// IsNumber return true if the cell is the number
func (c cell) IsNumber() bool {
_, ok := c.contentHandler.(*NumberCol)
return ok
}
// MustNumber always return number
func (c cell) MustNumber() *NumberCol {
return c.contentHandler.(*NumberCol)
}
// IsFormula return true if the cell is formula
func (c cell) IsFormula() bool {
_, ok := c.contentHandler.(*FormulaCol)
return ok
}
// MustFormula always return formula
func (c cell) MustFormula() *FormulaCol {
return c.contentHandler.(*FormulaCol)
}
// IsBlank return true if the cell is blank
func (c cell) IsBlank() bool {
_, ok := c.contentHandler.(*BlankCol)
return ok
}
// MustBlank always return blank
func (c cell) MustBlank() *BlankCol {
return c.contentHandler.(*BlankCol)
}
// IsRk return true if the cell is rk
func (c cell) IsRk() bool {
_, ok := c.contentHandler.(*RkCol)
return ok
}
// MustRk alwasy return RkCol
func (c cell) MustRk() *RkCol {
return c.contentHandler.(*RkCol)
}