psmith 2003/09/16 18:14:09 Modified: src/java/org/apache/log4j/chainsaw ChainsawColumns.java Log: added a new very simple helper method. Revision Changes Path 1.3 +12 -2 jakarta-log4j/src/java/org/apache/log4j/chainsaw/ChainsawColumns.java Index: ChainsawColumns.java =================================================================== RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/chainsaw/ChainsawColumns.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ChainsawColumns.java 4 Sep 2003 02:27:15 -0000 1.2 +++ ChainsawColumns.java 17 Sep 2003 01:14:09 -0000 1.3 @@ -78,7 +78,7 @@ //NOTE: ID must ALWAYS be last field because the model adds this value itself as an identifier to the end of the consructed vector columnNames.add(ChainsawConstants.ID_COL_NAME); } - + public static final int INDEX_LOGGER_COL_NAME = 1; public static final int INDEX_TIMESTAMP_COL_NAME = 2; public static final int INDEX_LEVEL_COL_NAME = 3; @@ -93,11 +93,21 @@ public static final int INDEX_LINE_COL_NAME = 12; public static final int INDEX_PROPERTIES_COL_NAME = 13; public static final int INDEX_ID_COL_NAME = 14; - + private ChainsawColumns() { } public static List getColumnsNames() { return columnNames; + } + + /** + * Given the index which matches one of the static constants in this class, returns the resolved + * Column name as a string label. + * @param columnIndex (not this is a 1 based collection) + * @return + */ + public static String getColumnName(int columnIndex) { + return getColumnsNames().get(columnIndex - 1).toString(); } }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]