22 lines
650 B
Java
22 lines
650 B
Java
package com.code.leet.entiy;
|
|
|
|
import java.util.List;
|
|
|
|
/**
|
|
* @Author: hyy
|
|
* @Date: 2020-02-13 19:19
|
|
*/
|
|
|
|
public interface NestedInteger {
|
|
|
|
// @return true if this NestedInteger holds a single integer, rather than a nested list.
|
|
public boolean isInteger();
|
|
|
|
// @return the single integer that this NestedInteger holds, if it holds a single integer
|
|
// Return null if this NestedInteger holds a nested list
|
|
public Integer getInteger();
|
|
|
|
// @return the nested list that this NestedInteger holds, if it holds a nested list
|
|
// Return null if this NestedInteger holds a single integer
|
|
public List<NestedInteger> getList();
|
|
} |