Class CombinedName

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

public class CombinedName extends Object implements MultiName
A name which is unique when a primaryName is combined with a secondaryName

In some cases (e.g. when grouping) the primaryName has relevance.

Author:
Owen
  • Constructor Details

    • CombinedName

      public CombinedName(String key, String remainder)
      Creates with explicit strings for both parts.
      Parameters:
      key - first-part (and key used for aggregating).
      remainder - the second-part (all the names not used in aggregating joined together).
  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      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:
      obj - the other name.
      Returns:
      true iff the two objects are equal.
    • 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.
    • iterator

      public Iterator<String> iterator()
      Specified by:
      iterator in interface Iterable<String>
    • 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.
    • 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.
    • compareTo

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