Here you can find the source of isReflectanceType(TreeNode productTypeNode, String type)
private static boolean isReflectanceType(TreeNode productTypeNode, String type)
//package com.java2s; //License from project: GNU General Public License import javax.swing.tree.TreeNode; public class Main { private static boolean isReflectanceType(TreeNode productTypeNode, String type) {//from www . j a v a 2 s . co m for (int i = 0; i < productTypeNode.getChildCount(); i++) { // we have: 'GEOMETRY', 'NDVI', 'QUALITY', 'RADIOMETRY', 'TIME' final TreeNode productTypeChildNode = productTypeNode .getChildAt(i); final String productTypeChildNodeName = productTypeChildNode .toString(); if (productTypeChildNodeName.equals("RADIOMETRY")) { // children are BLUE, RED, NIR, SWIR final TreeNode radiometryChildNode = productTypeChildNode .getChildAt(0); return radiometryChildNode.getChildAt(0).toString() .equals(type); } } return false; } }