예제 #1
0
    public final Object getColumnValue(Object row, int columnIndex) {
      try {
        Node node = (Node) row;

        switch (columnIndex) {
          case 0:
            if (node.label == null) {
              IObject obj = snapshot.getObject(node.objectId);
              node.label = obj.getDisplayName();
              node.shallowHeap = obj.getUsedHeapSize();
            }
            return node.label;
          case 1:
            if (node.shallowHeap == -1) node.shallowHeap = snapshot.getHeapSize(node.objectId);
            return node.shallowHeap;
          case 2:
            if (node.retainedHeap == -1)
              node.retainedHeap = snapshot.getRetainedHeapSize(node.objectId);
            return node.retainedHeap;
        }
      } catch (SnapshotException e) {
        throw new RuntimeException(e);
      }

      return null;
    }