Example #1
0
        // instance cache ---------------------------------------------------------- ***

        private Norm2AllModes(Normalizer2Impl ni)
        {
            Impl   = ni;
            Comp   = new ComposeNormalizer2(ni, false);
            Decomp = new DecomposeNormalizer2(ni);
            Fcd    = new FCDNormalizer2(ni);
            Fcc    = new ComposeNormalizer2(ni, true);
        }
Example #2
0
 internal void EnsureOwnedData()
 {
     if (ownedData == null)
     {
         Normalizer2Impl nfcImpl = Norm2AllModes.GetNFCInstance().Impl;
         ownedData = new CollationData(nfcImpl);
     }
     data = ownedData;
 }
Example #3
0
 public Norm2AllModesSingleton(string name)
 {
     try
     {
         Normalizer2Impl impl = new Normalizer2Impl().Load(name + ".nrm");
         allModes = new Norm2AllModes(impl);
     }
     catch (Exception e)
     {
         exception = e;
     }
 }
Example #4
0
            protected override Norm2AllModes CreateInstance(string key, ByteBuffer bytes)
            {
                Normalizer2Impl impl;

                if (bytes == null)
                {
                    impl = new Normalizer2Impl().Load(key + ".nrm");
                }
                else
                {
                    impl = new Normalizer2Impl().Load(bytes);
                }
                return(new Norm2AllModes(impl));
            }
Example #5
0
 public static Norm2AllModes GetInstance(ByteBuffer bytes, string name) // ICU4N TODO: API - Eliminate ByteBuffer
 {
     if (bytes == null)
     {
         Norm2AllModesSingleton singleton;
         if (name.Equals("nfc", StringComparison.OrdinalIgnoreCase))
         {
             singleton = NFCSingleton.Instance;
         }
         else if (name.Equals("nfkc", StringComparison.OrdinalIgnoreCase))
         {
             singleton = NFKCSingleton.Instance;
         }
         else if (name.Equals("nfkc_cf", StringComparison.OrdinalIgnoreCase))
         {
             singleton = NFKC_CFSingleton.Instance;
         }
         else
         {
             singleton = null;
         }
         if (singleton != null)
         {
             if (singleton.exception != null)
             {
                 throw singleton.exception;
             }
             return(singleton.allModes);
         }
     }
     return(cache.GetOrCreate(name, (key) =>
     {
         Normalizer2Impl impl;
         if (bytes == null)
         {
             impl = new Normalizer2Impl().Load(key + ".nrm");
         }
         else
         {
             impl = new Normalizer2Impl().Load(bytes);
         }
         return new Norm2AllModes(impl);
     }));
 }
Example #6
0
 public FCDNormalizer2(Normalizer2Impl ni)
     : base(ni)
 {
 }
Example #7
0
 public ComposeNormalizer2(Normalizer2Impl ni, bool fcc)
     : base(ni)
 {
     onlyContiguous = fcc;
 }
Example #8
0
 public DecomposeNormalizer2(Normalizer2Impl ni)
     : base(ni)
 {
 }
Example #9
0
 public Normalizer2WithImpl(Normalizer2Impl ni)
 {
     impl = ni;
 }
Example #10
0
 internal CollationData(Normalizer2Impl nfc)
 {
     nfcImpl = nfc;
 }