nestedint

package
v0.0.0-...-bced520 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 7, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NestedInteger

type NestedInteger interface {
	// IsInteger returns true if this NestedInteger holds a single integer,
	// rather than a nested list.
	IsInteger() bool

	// GetInteger 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
	GetInteger() int

	// SetInteger sets this NestedInteger to hold a single integer.
	SetInteger(value int)

	// Add sets this NestedInteger to hold a nested list and adds a nested integer to it.
	Add(elem NestedInteger)

	// GetList returns 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
	GetList() []*NestedInteger
}

NestedInteger holds a single integer or nested list.

func NewNestedInteger

func NewNestedInteger() NestedInteger

NewNestedInteger returns a zero value NestedInteger.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL