/*
 * (C) Copyright IBM Corp. 1997-1998  All rights reserved.
 *
 * US Government Users Restricted Rights Use, duplication or
 * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
 *
 * The program is provided "as is" without any warranty express or
 * implied, including the warranty of non-infringement and the implied
 * warranties of merchantibility and fitness for a particular purpose.
 * IBM will not be liable for any damages suffered by you as a result
 * of using the Program. In no event will IBM be liable for any
 * special, indirect or consequential damages or lost profits even if
 * IBM has been advised of the possibility of their occurrence. IBM
 * will not be liable for any third party claims against you.
 */

package com.ibm.xml.xpointer;

import java.util.Enumeration;
import java.util.Vector;

/**
 * (Based on <a href="http://www.w3.org/TR/1998/WD-xptr-19980303">WD-xptr-19980303</a>)
 *
 * @version 1.1
 * @author TAMURA Kent &lt;kent@trl.ibm.co.jp&gt;
 */

public class RelTermAttribute implements java.io.Serializable {
    String m_attr;                              // "*" / Name
    int m_type;                                 // T_IMPLIED / T_ANY / T_NAME / T_EXACT
    String m_value;                             // "#IMPLIED" / "*" / Name / a content of SkipLit

    /**
     *
     * @param type  XPointer.T_IMPLIED / XPointer.T_ANY / XPointer.T_NAME / XPointer.T_EXACT
     * @param attr "*" or an attribute name
     */
    public RelTermAttribute(int type, String attr, String value) {
        m_attr = attr;
        m_type = type;
        m_value = value;
    }

    /**
     *
     */
    public String getName() {
        return m_attr;
    }

    /**
     *
     */
    public int getValueType() {
        return m_type;
    }

    /**
     *
     */
    public String getValue() {
        return m_value;
    }

    /**
     *
     */
    public String toString() {
        return ","+m_attr+","+(m_type == XPointer.T_EXACT ? XPointerParser.makeSkipLit(m_value) : m_value);
    }

}
