com.im.commons 5.9

com.im.commons.util
Enum JChemCols

java.lang.Object
  extended by java.lang.Enum<JChemCols>
      extended by com.im.commons.util.JChemCols
All Implemented Interfaces:
Serializable, Comparable<JChemCols>

public enum JChemCols
extends Enum<JChemCols>

Common utilities and constants for work with JChem well-known columns with prefix "CD_".


Enum Constant Summary
CD_FORMULA
           
CD_ID
           
CD_MARKUSH
           
CD_MOLWEIGHT
           
CD_SORTABLE_FORMULA
           
CD_STRUCTURE
           
 
Method Summary
 String getDisplayName()
          Get display name of the column type.
static String getStructureColumnDisplayName(int tableType)
          Get display name of the structure field (CD_STRUCTURE) based on table type.
static String getTableDisplayName(int tableType)
          Returns default display name for specific tableType.
static boolean isJChemColumn(String columnName)
          Is this column JChem reserved? In other words does the name start with "CD_" (ignore case)?
 String lowerCase()
          Returns constant as lower case String, e.g.
 boolean match(String columnName)
          Does columnName represent this CD_xx column? Just compare enum value toString() with columnName (case insensitive).
static String removeJChemPrefix(String columnName)
          Remove "CD_" prefix if columnName starts with this String.
static JChemCols valueOf(String name)
          Returns the enum constant of this type with the specified name.
static JChemCols[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

CD_ID

public static final JChemCols CD_ID

CD_STRUCTURE

public static final JChemCols CD_STRUCTURE

CD_MOLWEIGHT

public static final JChemCols CD_MOLWEIGHT

CD_FORMULA

public static final JChemCols CD_FORMULA

CD_SORTABLE_FORMULA

public static final JChemCols CD_SORTABLE_FORMULA

CD_MARKUSH

public static final JChemCols CD_MARKUSH
Method Detail

values

public static JChemCols[] 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 (JChemCols c : JChemCols.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static JChemCols valueOf(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:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

lowerCase

public String lowerCase()
Returns constant as lower case String, e.g. "cd_structure"


getDisplayName

public String getDisplayName()
Get display name of the column type. This name should be used for field which represent CD_xx column.


match

public boolean match(String columnName)
Does columnName represent this CD_xx column? Just compare enum value toString() with columnName (case insensitive).

Parameters:
columnName -
Returns:
true if columnName is equalsIgnoreCase with this CD_xx constant.

getStructureColumnDisplayName

public static String getStructureColumnDisplayName(int tableType)
Get display name of the structure field (CD_STRUCTURE) based on table type. Table type constants must be one of TableTypeConstants.


getTableDisplayName

public static String getTableDisplayName(int tableType)
Returns default display name for specific tableType. Table type constants must be one of TableTypeConstants.


isJChemColumn

public static boolean isJChemColumn(String columnName)
Is this column JChem reserved? In other words does the name start with "CD_" (ignore case)?

Parameters:
columnName - Column name to be tested
Returns:
true if columnName starts with "CD_" string (ignore case)

removeJChemPrefix

public static String removeJChemPrefix(String columnName)
Remove "CD_" prefix if columnName starts with this String. Otherwise returns the original String.


com.im.commons 5.9