src/main/java/com/mxgraph/model/mxCellPath.java
public static int compare(String cp1, String cp2)
	{
		StringTokenizer p1 = new StringTokenizer(cp1, mxCellPath.PATH_SEPARATOR);
		StringTokenizer p2 = new StringTokenizer(cp2, mxCellPath.PATH_SEPARATOR);
		int comp = 0;
		
		while (p1.hasMoreTokens() &&
			p2.hasMoreTokens())
		{
			String t1 = p1.nextToken();
			String t2 = p2.nextToken();
	
			if (!t1.equals(t2))
			{
				if (t1.length() == 0 ||
					t2.length() == 0)
				{
					comp = t1.compareTo(t2);
				}
				else
				{
					comp = Integer.valueOf(t1).compareTo(Integer.valueOf(t2));
				}
				
				break;
			}
		}
		
		// Compares path length if both paths are equal to this point
		if (comp == 0)
		{
			int t1 = p1.countTokens();
			int t2 = p2.countTokens();
			
			if (t1 != t2)
			{
				comp = (t1 > t2) ? 1 : -1;
			}
		}
		
		return comp;
	}
/**
	 * Compares the given cell paths and returns -1 if cp1 is smaller, 0 if
	 * cp1 is equal and 1 if cp1 is greater than cp2.
	 */
Compares the given cell paths and returns -1 if cp1 is smaller, 0 if
cp1 is equal and 1 if cp1 is greater than cp2.
Compares the given cell paths and returns - 1 if cp1 is smaller 0 if cp1 is equal and 1 if cp1 is greater than cp2 .
public static int compare(String cp1, String cp2)
	{
		StringTokenizer p1 = new StringTokenizer(cp1, mxCellPath.PATH_SEPARATOR);
		StringTokenizer p2 = new StringTokenizer(cp2, mxCellPath.PATH_SEPARATOR);
		int comp = 0;
		while (p1.hasMoreTokens() &&
			p2.hasMoreTokens())
		{
			String t1 = p1.nextToken();
			String t2 = p2.nextToken();
			if (!t1.equals(t2))
			{
				if (t1.length() == 0 ||
					t2.length() == 0)
				{
					comp = t1.compareTo(t2);
				}
				else
				{
					comp = Integer.valueOf(t1).compareTo(Integer.valueOf(t2));
				}
				break;
			}
		}
		if (comp == 0)
		{
			int t1 = p1.countTokens();
			int t2 = p2.countTokens();
			if (t1 != t2)
			{
				comp = (t1 > t2) ? 1 : -1;
			}
		}
		return comp;
	}
public static int compare ( String cp1 , String cp2 ) { StringTokenizer p1 = new StringTokenizer ( cp1 , mxCellPath . PATH_SEPARATOR ) ; StringTokenizer p2 = new StringTokenizer ( cp2 , mxCellPath . PATH_SEPARATOR ) ; int comp = 0 ; while ( p1 . hasMoreTokens ( ) && p2 . hasMoreTokens ( ) ) { String t1 = p1 . nextToken ( ) ; String t2 = p2 . nextToken ( ) ; if ( ! t1 . equals ( t2 ) ) { if ( t1 . length ( ) == 0 || t2 . length ( ) == 0 ) { comp = t1 . compareTo ( t2 ) ; } else { comp = Integer . valueOf ( t1 ) . compareTo ( Integer . valueOf ( t2 ) ) ; } break ; } } if ( comp == 0 ) { int t1 = p1 . countTokens ( ) ; int t2 = p2 . countTokens ( ) ; if ( t1 != t2 ) { comp = ( t1 > t2 ) ? 1 : - 1 ; } } return comp ; }
Compares the given cell paths and returns -1 if cp1 is smaller, 0 if
 cp1 is equal and 1 if cp1 is greater than cp2.
Compares the given cell paths and returns - 1 if cp1 is smaller 0 if cp1 is equal and 1 if cp1 is greater than cp2 .
// Compares path length if both paths are equal to this point