Class LocalizedNameGenerator

  • All Implemented Interfaces:
    <>, <>

    public class LocalizedNameGenerator
    extends 
    implements <>, <>
    Generates name variations for a given file name or path and a locale. The name variations are provided in most-specific to least-specific order, so for a path of "Base.ext" and a Locale of "en_US", the generated names would be "Base_en_US.ext", "Base_en.ext", "Base.ext". Implements Iterable, so a LocalizedNameGenerator may be used directly in a for loop. This class is not threadsafe.
    Since:
    5.3
    • Constructor Summary

      Constructors 
      Constructor Description
       path,  locale)
      Creates a new generator for the given path and locale.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      getCurrentLocale()  
      boolean hasNext()
      Returns true if there are more name variants to be returned, false otherwise.
      <> iterator()
      So that LNG may be used with the for loop.
      next()
      Returns the next localized variant.
      void remove()  
      • Methods inherited from class java.lang.

        , , , , , , , , , ,
      • Methods inherited from interface java.lang.

        ,
      • Methods inherited from interface java.util.

    • Constructor Detail

      • LocalizedNameGenerator

        public  path,
                                       locale)
        Creates a new generator for the given path and locale.
        Parameters:
        path - non-blank path
        locale - non-null locale
    • Method Detail

      • hasNext

        public boolean hasNext()
        Returns true if there are more name variants to be returned, false otherwise.
        Specified by:
         in interface <>
      • next

        public  next()
        Returns the next localized variant.
        Specified by:
         in interface <>
        Throws:
        - if all variants have been returned.
      • remove

        public void remove()
        Specified by:
         in interface <>
        Throws:
      • iterator

        public <> iterator()
        So that LNG may be used with the for loop.
        Specified by:
         in interface <>