Class NameSequencer

  • All Implemented Interfaces:
    Sequencer, java.util.Comparator<ShapeElement>
    Direct Known Subclasses:
    NumberingSequencer

    @OpenApiAll
    public class NameSequencer
    extends java.lang.Object
    implements Sequencer
    Alphanumeric sequencer. Sorts alphabetically (uses the same sorting comparator as containment tree)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String NAME  
    • Constructor Summary

      Constructors 
      Constructor Description
      NameSequencer()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(ShapeElement shape1, ShapeElement shape2)  
      protected int compareStrings​(java.lang.String string1, java.lang.String string2)
      Compares two strings alphanumerically.
      java.lang.String getName()
      The name of the sequencer
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Comparator

        equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
    • Field Detail

      • NAME

        public static final java.lang.String NAME
    • Constructor Detail

      • NameSequencer

        public NameSequencer()
    • Method Detail

      • getName

        public java.lang.String getName()
        Description copied from interface: Sequencer
        The name of the sequencer
        Specified by:
        getName in interface Sequencer
        Returns:
        sequencer name
      • compareStrings

        protected int compareStrings​(@CheckForNull
                                     java.lang.String string1,
                                     @CheckForNull
                                     java.lang.String string2)
        Compares two strings alphanumerically. Empty strings are placed at the end. Null values are translated into empty strings.
        Parameters:
        string1 - first string
        string2 - second string
        Returns:
        compare result