// 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); }
internal void EnsureOwnedData() { if (ownedData == null) { Normalizer2Impl nfcImpl = Norm2AllModes.GetNFCInstance().Impl; ownedData = new CollationData(nfcImpl); } data = ownedData; }
public Norm2AllModesSingleton(string name) { try { Normalizer2Impl impl = new Normalizer2Impl().Load(name + ".nrm"); allModes = new Norm2AllModes(impl); } catch (Exception e) { exception = e; } }
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)); }
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); })); }
public FCDNormalizer2(Normalizer2Impl ni) : base(ni) { }
public ComposeNormalizer2(Normalizer2Impl ni, bool fcc) : base(ni) { onlyContiguous = fcc; }
public DecomposeNormalizer2(Normalizer2Impl ni) : base(ni) { }
public Normalizer2WithImpl(Normalizer2Impl ni) { impl = ni; }
internal CollationData(Normalizer2Impl nfc) { nfcImpl = nfc; }