|
From: Lukas P. <pe...@us...> - 2002-09-03 17:51:48
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes
In directory usw-pr-cvs1:/tmp/cvs-serv16381
Modified Files:
InterfaceRepository.java
Log Message:
added getDefaultSort
Index: InterfaceRepository.java
===================================================================
RCS file: /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes/InterfaceRepository.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** InterfaceRepository.java 31 Aug 2002 08:41:42 -0000 1.2
--- InterfaceRepository.java 3 Sep 2002 17:51:44 -0000 1.3
***************
*** 40,44 ****
/** This class provides static methods that describe JPI objects. It is used for
* higher-order working with JPI objects and for presenting these objects to
! * end use.
* @author Lukas Petru
*/
--- 40,44 ----
/** This class provides static methods that describe JPI objects. It is used for
* higher-order working with JPI objects and for presenting these objects to
! * end user.
* @author Lukas Petru
*/
***************
*** 187,190 ****
--- 187,236 ----
}
+ public static Integer getDefaultSort(int type) {
+ switch(type) {
+ case Constants.THREAD:
+ case Constants.TYPE:
+ case Constants.ALLOC_TRACE:
+ case Constants.ALLOC_TYPE_TRACE:
+ case Constants.METHOD:
+ return new Integer(PDataComparator.ALLOC_LIVE);
+ case Constants.CPU_TRACE:
+ case Constants.CPU_THREAD_TRACE:
+ return new Integer(PDataComparator.CPU);
+ case Constants.MON_TRACE:
+ case Constants.MON_THREAD_TRACE:
+ return new Integer(PDataComparator.MON);
+ default:
+ return new Integer(PDataComparator.ZERO);
+ }
+ }
+
+ /** Returns types of parent objects (for multi-rooted objects). */
+ public static int[] getParentTypes(int type) {
+ switch(type) {
+ case Constants.NONE:
+ case Constants.THREAD:
+ case Constants.CPU_TRACE:
+ return new int[]{};
+ case Constants.CPU_THREAD_TRACE:
+ return new int[]{Constants.THREAD, Constants.CPU_TRACE};
+ case Constants.MON_TRACE:
+ return new int[]{};
+ case Constants.MON_THREAD_TRACE:
+ return new int[]{Constants.THREAD, Constants.MON_TRACE};
+ case Constants.TYPE:
+ case Constants.ALLOC_TRACE:
+ return new int[]{};
+ case Constants.ALLOC_TYPE_TRACE:
+ return new int[]{Constants.TYPE, Constants.ALLOC_TRACE};
+ case Constants.THREADGROUP:
+ case Constants.CLASS:
+ case Constants.METHOD:
+ case Constants.FIELD:
+ return new int[]{};
+ }
+ throw new IllegalArgumentException("Illegal:"+String.valueOf(type));
+ }
+
private static void init() {
if (!isInit) {
***************
*** 222,225 ****
--- 268,274 ----
/*
* $Log$
+ * Revision 1.3 2002/09/03 17:51:44 petrul
+ * added getDefaultSort
+ *
* Revision 1.2 2002/08/31 08:41:42 petrul
* hasAlloc, hasCPU and hasMon
|