/*
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * published by the Free Software Foundation; either version 2.1 of
 * the license, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *  
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite
 * 330, Boston, MA  02111-1307, USA.
 * 
 */
package com.k_int.xrtree;

import java.io.Serializable;

/**
 * Title:		DataNode
 * @author:		Rob Tice (rob.tice@k-int.com)
 * @version:	$Id: $
 * Copyright:	Copyright 1999-2006 Knowledge Integration Ltd
 * Company: 	Knowledge Integration Ltd
 * Description:
 * 
 * 
 *
 * Created:		Jun 13, 2006
 * 
 * 
 * History
 *				$Log: $
 * 		
 */

public class DataNode implements Serializable
{
    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String id;
    private String description;
    private String name;
    private String source;
    private int type;
    
    
    public void setId(String id)
    {
        this.id=id;
    }
    
    public String getId()
    {
        return id;
    }
      
    public void setName(String name)
    {
        this.name=name;
    }
      
    public String getName()
    {
        return name;
    }
    
    public void setSource(String source)
    {
        this.source=source;
    }
    
    public String getSource()
    {
        return source;
    }
    
    public void setType(int type)
    {
        this.type=type;
    }
    
    public int getType()
    {
        return type;
    }
    
    public void setDescription(String description)
    {
        this.description=description;
    }
    
    public String getDescription()
    {
        return description;
    }
    
    
    public String toString()
    {
        return getName()+": "+getId()+": "+getSource();
    }
    
    public boolean equals(Object node_obj)
    {
      boolean retval=false;
      DataNode node = (DataNode) node_obj;
      if(node.getSource().equals(source) && node.getId().equals(id))
        retval=true;
      return retval;
    }
    
    public int hashCode()
    {   
      return id.hashCode()+source.hashCode();
    }
}
