Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type NestedInteger ¶
type NestedInteger struct { }
This is the interface that allows for creating nested lists. You should not implement it, or speculate about its implementation
func (NestedInteger) Add ¶
func (n NestedInteger) Add(elem NestedInteger)
Set this NestedInteger to hold a nested list and adds a nested integer to it.
func (NestedInteger) GetInteger ¶
func (n NestedInteger) GetInteger() int
Return the single integer that this NestedInteger holds, if it holds a single integer The result is undefined if this NestedInteger holds a nested list So before calling this method, you should have a check
func (NestedInteger) GetList ¶
func (n NestedInteger) GetList() []NestedInteger
Return the nested list that this NestedInteger holds, if it holds a nested list The list length is zero if this NestedInteger holds a single integer You can access NestedInteger's List element directly if you want to modify it
func (NestedInteger) IsInteger ¶
func (n NestedInteger) IsInteger() bool
Return true if this NestedInteger holds a single integer, rather than a nested list.
func (NestedInteger) SetInteger ¶
func (n NestedInteger) SetInteger(value int)
Set this NestedInteger to hold a single integer.