package jas2.util.tree;
import java.io.*;
public class TreeItem implements Externalizable, Cloneable
{
public String[] path;
public String type;
public int flags;
public final static int HAS_SUB_ITEMS = 1;
public final static int DELETED = 2;
public final static int FOLDER = 4;
public TreeItem()
{
}
public TreeItem(String s)
{
String[] p = { s };
this.path = p;
}
public TreeItem(String s, String type)
{
this(s,type,0);
}
public TreeItem(String s, String type, int flags)
{
String[] p = { s };
this.path = p;
this.type = type;
this.flags = flags;
}
public TreeItem(String[] path, String type, int flags)
{
this.path = path;
this.type = type;
this.flags = flags;
}
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
path = (String[]) in.readObject();
type = (String) in.readObject();
flags = in.readInt();
}
public void writeExternal(ObjectOutput out) throws IOException
{
out.writeObject(path);
out.writeObject(type);
out.writeInt(flags);
}
public boolean equals(Object in)
{
if (!(in instanceof TreeItem)) return false;
TreeItem item = (TreeItem) in;
if (item.path.length != path.length) return false;
if (path == null || item.path == null) return path == item.path;
for (int i=0; i
Ads help maintain this website.