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

com_github_leetcode.NestedInteger Maven / Gradle / Ivy

There is a newer version: 1.24
Show newest version
package com_github_leetcode;

import java.util.ArrayList;
import java.util.List;

public class NestedInteger {
    private List list;
    private Integer integer;

    public NestedInteger() {
        this.list = new ArrayList<>();
    }

    public NestedInteger(List list) {
        this.list = list;
    }

    public NestedInteger(Integer integer) {
        this.integer = integer;
    }

    public boolean isInteger() {
        return integer != null;
    }

    public Integer getInteger() {
        return integer;
    }

    public List getList() {
        return list;
    }

    public void add(NestedInteger nestedInteger) {
        this.list.add(nestedInteger);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy