All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com_github_leetcode.NestedInteger.kt Maven / Gradle / Ivy

There is a newer version: 1.30
Show newest version
package com_github_leetcode

class NestedInteger {
    private var list: MutableList? = null
    private var integer: Int? = null

    constructor() {
        list = ArrayList()
    }

    constructor(list: MutableList?) {
        this.list = list
    }

    constructor(integer: Int?) {
        this.integer = integer
    }

    fun isInteger(): Boolean {
        return integer != null
    }

    fun getInteger(): Int? {
        return integer
    }

    fun getList(): List? {
        return list
    }

    fun add(nestedInteger: NestedInteger) {
        list!!.add(nestedInteger)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy