/*
 * Java-Gnome Bindings Library
 *
 * Copyright 1998-2004 the Java-Gnome Team, all rights reserved.
 *
 * The Java-Gnome bindings library is free software distributed under
 * the terms of the GNU Library General Public License version 2.
 */

package org.gnu.pango;
import org.gnu.glib.Enum;


/**
 * Distinguishes between different types of attributes.
 */
public class AttrType extends Enum 
{
    /****************************************
     * BEGINNING OF GENERATED CODE
     ****************************************/
    static final private int _INVALID = 0;
    static final public org.gnu.pango.AttrType INVALID = new org.gnu.pango.AttrType (_INVALID);
    static final private int _LANGUAGE = 1;
    static final public org.gnu.pango.AttrType LANGUAGE = new org.gnu.pango.AttrType (_LANGUAGE);
    static final private int _FAMILY = 2;
    static final public org.gnu.pango.AttrType FAMILY = new org.gnu.pango.AttrType (_FAMILY);
    static final private int _STYLE = 3;
    static final public org.gnu.pango.AttrType STYLE = new org.gnu.pango.AttrType (_STYLE);
    static final private int _WEIGHT = 4;
    static final public org.gnu.pango.AttrType WEIGHT = new org.gnu.pango.AttrType (_WEIGHT);
    static final private int _VARIANT = 5;
    static final public org.gnu.pango.AttrType VARIANT = new org.gnu.pango.AttrType (_VARIANT);
    static final private int _STRETCH = 6;
    static final public org.gnu.pango.AttrType STRETCH = new org.gnu.pango.AttrType (_STRETCH);
    static final private int _SIZE = 7;
    static final public org.gnu.pango.AttrType SIZE = new org.gnu.pango.AttrType (_SIZE);
    static final private int _FONT_DESC = 8;
    static final public org.gnu.pango.AttrType FONT_DESC = new org.gnu.pango.AttrType (_FONT_DESC);
    static final private int _FOREGROUND = 9;
    static final public org.gnu.pango.AttrType FOREGROUND = new org.gnu.pango.AttrType (_FOREGROUND);
    static final private int _BACKGROUND = 10;
    static final public org.gnu.pango.AttrType BACKGROUND = new org.gnu.pango.AttrType (_BACKGROUND);
    static final private int _UNDERLINE = 11;
    static final public org.gnu.pango.AttrType UNDERLINE = new org.gnu.pango.AttrType (_UNDERLINE);
    static final private int _STRIKETHROUGH = 12;
    static final public org.gnu.pango.AttrType STRIKETHROUGH = new org.gnu.pango.AttrType (
        _STRIKETHROUGH);
    static final private int _RISE = 13;
    static final public org.gnu.pango.AttrType RISE = new org.gnu.pango.AttrType (_RISE);
    static final private int _SHAPE = 14;
    static final public org.gnu.pango.AttrType SHAPE = new org.gnu.pango.AttrType (_SHAPE);
    static final private int _SCALE = 15;
    static final public org.gnu.pango.AttrType SCALE = new org.gnu.pango.AttrType (_SCALE);
    static final private org.gnu.pango.AttrType[] theInterned = new org.gnu.pango.AttrType[] 
    {
        INVALID, LANGUAGE, FAMILY, STYLE, WEIGHT, VARIANT, STRETCH, SIZE, FONT_DESC, FOREGROUND, 
        BACKGROUND, UNDERLINE, STRIKETHROUGH, RISE, SHAPE, SCALE 
    }

;
    static private java.util.Hashtable theInternedExtras;
    static final private org.gnu.pango.AttrType theSacrificialOne = new org.gnu.pango.AttrType (0);
    static public org.gnu.pango.AttrType intern (int value) 
    {
        if (value < theInterned.length) 
        {
            return theInterned[value];
        }
        theSacrificialOne.value_ = value;
        if (theInternedExtras == null) 
        {
            theInternedExtras = new java.util.Hashtable();
        }
        org.gnu.pango.AttrType already = (org.gnu.pango.AttrType) theInternedExtras.get (
            theSacrificialOne);
        if (already == null) 
        {
            already = new org.gnu.pango.AttrType(value);
            theInternedExtras.put(already, already);
        }
        return already;
    }

    private AttrType (int value) 
    {
        value_ = value;
    }

    public org.gnu.pango.AttrType or (org.gnu.pango.AttrType other) 
    {
        return intern(value_ | other.value_);
    }

    public org.gnu.pango.AttrType and (org.gnu.pango.AttrType other) 
    {
        return intern(value_ & other.value_);
    }

    public org.gnu.pango.AttrType xor (org.gnu.pango.AttrType other) 
    {
        return intern(value_ ^ other.value_);
    }

    public boolean test (org.gnu.pango.AttrType other) 
    {
        return (value_ & other.value_) == other.value_;
    }

    /****************************************
     * END OF GENERATED CODE
     ****************************************/
}

