/* Copyright (C) 2009  CSE,IIT Bombay  http://www.cse.iitb.ac.in

This file is part of the ConStore open source storage facility for concept-nets.

ConStore is free software and distributed under the 
Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Unported License;
you can copy, distribute and transmit the work
with the work attribution in the manner specified by the author or licensor.
You may not use this work for commercial purposes and may not alter, 
transform, or build upon this work.

Please refer the legal code of the license, available at
http://creativecommons.org/licenses/by-nc-nd/3.0/legalcode

ConStore 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.  */

package iitb.con.core;



/**
 * <code>Instance</code> is the instantiated item of the <code>Type</code>.<br>
 * All the instances of specialized type will extend the <code>Instance</code> class.
 * 
 * @see Type
 * @author Prathab K
 */

public abstract class Instance {
    
    /** Instance Id */
    public int id;
    
    /** Type of the instance */
    protected Type type;
    
    /** Type name of the instance */
    public short typeId;
    
    /**
     * Sets the type of the instance
     * @param type {@link Type}
     */
    public void setType(Type type) {
        this.type = type;
        this.typeId = type.id;
    }
    
    /**
     * Sets the instance's attribute value.<br>
     * <tt>This method should be over-ridden by the specialized instances</tt> 
     * @param name attribute name
     * @param value attribute's value
     */
    public void setAttributeValue(String name, Object value) {
    }
    
    /**
     * Returns the specified attributes value.<br>
     * <tt>This method should be over-ridden by the specialized instances</tt> 
     * @param name attribute name
     * @return attribute value
     */
    public Object getAttributeValue(String name){
        return null;
    }
}