
    
package performa.orm.types;

import java.util.*;
import oneit.utils.*;



/**
 * This class was generated using constGen.bat.
 * DO NOT MODIFY THIS CODE.
 * Edit the associated .xml file, and regenerate this file
 * constGen (directory) (file minus extension)
 * e.g. constGen C:\...\sql FieldType
 */

public class Interval extends AbstractEnumerated
{
    
    public static final EnumeratedFactory FACTORY_Interval = new IntervalFactory();
    
    public static final Interval DAY = new Interval ("DAY", "DAY", "Day", false);
    
    public static final Interval WEEK = new Interval ("WEEK", "WEEK", "Week", false);
    
    public static final Interval MONTH = new Interval ("MONTH", "MONTH", "Month", false);
    
    public static final Interval YEAR = new Interval ("YEAR", "YEAR", "Year", false);

    private static final Interval[] allIntervals =
        new Interval[] { DAY,WEEK,MONTH,YEAR};


    private static Interval[] getAllIntervals ()
    {
        return allIntervals;
    }

    private Interval (String name, String value, String description, boolean disabled)
    {
        super (name, value, description, disabled);
    }
    
    public static final Comparator COMPARE_BY_POSITION = new CompareEnumByPosition (allIntervals);



    static
    {
        defineAdditionalData ();
    }

    public boolean isEqual (Interval other)
    {
    return this.name.equals (other.name);
    }

    public Enumeration getAllInstances ()
    {
        return Interval.getAll ();
    }


    private Object readResolve() throws java.io.ObjectStreamException
    {
        return Interval.forName (this.name);
    }


    public EnumeratedFactory getFactory ()
    {
        return FACTORY_Interval;
    }

    public static Interval forName (String name)
    {
        if (name == null) { return null; }

        Interval[] all = getAllIntervals();
        int enumIndex = AbstractEnumerated.getIndexForName (all, name);

        return all[enumIndex];
    }


    public static Interval forValue (String value)
    {
        if (value == null) { return null; }

        Interval[] all = getAllIntervals();
        int enumIndex = AbstractEnumerated.getIndexForValue (getAllIntervals (), value);

        return all[enumIndex];
    }


    public static java.util.Enumeration getAll ()
    {
        return AbstractEnumerated.getAll (getAllIntervals());
    }
    
    
    public static Interval[] getIntervalArray ()
    {
        return (Interval[])getAllIntervals().clone ();
    }


    public static void defineAdditionalData ()
    {
        
    }


    static class IntervalFactory implements EnumeratedFactory
    {
        public AbstractEnumerated getForName (String name)
        {
            return Interval.forName (name);
        }

        public AbstractEnumerated getForValue (String name)
        {
            return Interval.forValue (name);
        }

        public Enumeration getAll ()
        {
            return Interval.getAll ();
        }
    }


    public Map getAdditionalAttributes ()
    {
        Map attribs = new HashMap ();

        
        return attribs;
    }
}

