Class SimpleName

Object
SimpleName
All Implemented Interfaces:
Comparable<MultiName>, Iterable<String>, MultiName

public class SimpleName extends Object implements MultiName
A name with only one part, and is always unique.
Author:
Owen Feehan
  • Constructor Details

    • SimpleName

      public SimpleName(String name)
  • Method Details

    • iterator

      public Iterator<String> iterator()
      Specified by:
      iterator in interface Iterable<String>
    • firstPart

      public Optional<String> firstPart()
      Description copied from interface: MultiName
      The first part, and grouping key.
      Specified by:
      firstPart in interface MultiName
      Returns:
      the name of part, if it exists.
    • secondPart

      public String secondPart()
      Description copied from interface: MultiName
      The second part of the name.
      Specified by:
      secondPart in interface MultiName
      Returns:
      the name of the part.
    • compareTo

      public int compareTo(MultiName other)
      Specified by:
      compareTo in interface Comparable<MultiName>
    • toString

      public String toString()
      Description copied from interface: MultiName
      The full name, including both directory and file part, as a string.
      Specified by:
      toString in interface MultiName
      Overrides:
      toString in class Object
      Returns:
      the name.
    • equals

      public boolean equals(Object o)
      Description copied from interface: MultiName
      If another name is equal to the current name.
      Specified by:
      equals in interface MultiName
      Overrides:
      equals in class Object
      Parameters:
      o - the other name.
      Returns:
      true iff the two objects are equal.
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object