/*
 */

package au.gov.ansto.bragg.nexus.tool;

/**
 *
 * @author drck
 * @version "%I%, %G%"
 */
public enum NeXusMultiplicityKind //implements NeXusMultiplicity
{    
        /* http://www.nexus.anl.gov/nexus_metaformat.html
        9. Following the opening tag of a group entity
           and before the closing tag of a data entity,
           there may be one of three symbols,
           which have the same meanings that they have in
           regular expressions.
        *   May occur 0 or more times
        +   May occur one or more times (i.e. at least once)
        ?   May occur 0 or one times (i.e. no more than once)
        */
    N_NX_ZERO_OR_ONE("?","May occur 0 or one times (i.e. no more than once)",false,false),
    
    N_NX_ZERO_OR_MORE("*","May occur 0 or more times",true,false),

    N_NX_ONE_OR_MORE("+","May occur one or more times (i.e. at least once)",true,true),//dke: May->Must
    
    N_NX_UNKNOWN(" ","WARNING: no multiplicity indicator found",false,false); //dke    
    
    NeXusMultiplicityKind(
            String symbol, 
            String info, 
            boolean indexed, 
            boolean required
            ) {
        
        symbol_ = symbol;
        
        info_ = info;
        
        indexed_ = indexed;
        
        required_ = required;
    }    
    
    public String toString() {return getSymbol();}
    
    private String symbol_;
    public String getSymbol() {return symbol_;}
    
    public char asChar() {return symbol_.charAt(0);}
    
    private String info_;
    public String getInfo() {return info_;}
    
    private boolean indexed_;
    public boolean isIndexed() {
        return indexed_;
    }
    
    private boolean required_;
    public boolean isRequired() {
        return required_;
    }    
}