Enum CIET

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<CIET>

    public enum CIET
    extends java.lang.Enum<CIET>
    CIET (Class, Interface, or Enumerated-Type) - Documentation.

    An Enumerated Type (enum) for identifying whether a java source code file is a Class, Interface or Enumerated Type.



    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      CLASS
      Identifies that the associated file represents a java 'class'
      ENUM
      Identifies that the associated file represents a java 'enum' (Enumerated-Type)
      INTERFACE
      Identifies that the associated file represents a java 'interface'
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method
      static CIET get​(String name)
      String toString()
      static CIET valueOf​(String name)
      static CIET[] values()
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • CLASS

        public static final CIET CLASS
        Identifies that the associated file represents a java 'class'
      • INTERFACE

        public static final CIET INTERFACE
        Identifies that the associated file represents a java 'interface'
      • ENUM

        public static final CIET ENUM
        Identifies that the associated file represents a java 'enum' (Enumerated-Type)
    • Method Detail

      • values

        public static CIET[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (CIET c : CIET.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static CIET valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • toString

        public java.lang.String toString()
        Returns the name of this CIET, in string format.
        Overrides:
        toString in class java.lang.Enum<CIET>
        Returns:
        Will return the name of this CIET as a String. The actual string returned is, in in all three cases, the restricted-java key-word that indicating whether this is a 'class' 'interface' or 'enum' (Enumerated-Type) by returning that exact String as a result when invoking this method.
        Code:
        Exact Method Body:
        1
         return name;
        
      • get

        public static CIET get​(java.lang.String name)
        Returns the enum constant of this type with the specified name. An invocation of '.trim().toLowerCase()' is performed, allowing white-space and oddly capitalized names for the String 'name' parameter.

        IMPORTANT NOTE: Java's enumerated-type auto-generated method 'valueOf(String name)' may not be over-ridden. Unfortunately, the String provided to this method only permits/tolerates Strings that are identical to the exact-spelling of the enum-constant itself. For instance: CIET.valueOf("CLASS") returns enumerated-constant CLASS. However if the string 'class' were passed, an 'IllegalArgumentException' would be thrown. In order to avoid this, this method get(String name) is provided as an alternative.
        Parameters:
        name - This is the CIET name, as a String.
        Returns:
        the CIET constant with the specified name
        Throws:
        java.lang.NullPointerException - if 'name' is null.
        java.lang.IllegalArgumentException - if, even after trim() and toLowerCase(), none of the CIET names-as-Strings equal the specified input parameter 'name'
        Code:
        Exact Method Body:
        1
        2
        3
        4
        5
        6
        7
        8
        9
         switch (name.trim().toLowerCase())
         {
             case "class"        : return CLASS;
             case "interface"    : return INTERFACE;
             case "enum"         : return ENUM;
             default             : throw new IllegalArgumentException(
                 "There was no CIET associated with the provided string: [" + name + "]."
             );
         }