Class Utilities


  • public class Utilities
    extends java.lang.Object
    Utilities for testing graphs. This class provides utilities, in the form of static methods, for testing graphs.
    Since:
    Ptolemy II 2.0
    Version:
    $Id$
    Author:
    Shuvra S. Bhattacharyya
    Pt.AcceptedRating:
    Red (cxh)
    Pt.ProposedRating:
    Red (cxh)
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String toSortedString​(java.util.Collection collection, boolean recursive)
      Given a collection, return a string representation of the collection.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • toSortedString

        public static java.lang.String toSortedString​(java.util.Collection collection,
                                                      boolean recursive)
        Given a collection, return a string representation of the collection. The representation returned is obtained by concatenating the string representations of the individual elements in their sorted order, as determined by the compareTo method of java.lang.String. If the recursive argument is true, then elements of the collection that are themselves collections are recursively converted to sorted strings using this method. When printing test results, this method can be used to guarantee a consistent representation for a collection regardless of the order in which elements are inserted and removed.
        Parameters:
        collection - The collection.
        recursive - True if elements of the collection that are themselves collections should be recursively converted to sorted strings.
        Returns:
        The string representation.