1 package net.sourceforge.phpdt.sql.view.bookmark;
3 import java.util.Vector;
5 public class ViewNode implements TreeNode, Comparable {
6 private BookmarkNode parent;
7 private Vector metadata;
10 public ViewNode(BookmarkNode parent, String tableName) {
12 this.name = tableName;
15 public Object getParent() {
19 public String getName() {
23 public String toString() {
27 public int compareTo(Object o) {
28 if (o instanceof ViewNode) {
29 ViewNode node = (ViewNode) o;
30 return name.compareTo(node.getName());
31 } else if (o instanceof SequenceNode) {
33 } else if (o instanceof TreeNode) {
39 public int getSize() {
43 public void setSize(int size) {
47 public boolean hasChildren() {
48 return (metadata != null) && (metadata.size() > 0);
51 public Object[] getChildren() {
52 if (metadata != null) {
53 return metadata.toArray();
55 return Root.EMPTY_ARRAY;
59 public void setMetadata(Vector metadata) {
60 this.metadata = metadata;