Пример #1
0
        static internal void GeneratePropertyAliases(bool showValues,
                                                     UnicodeProperty.Factory ups)
        {
            ComparatorInfo order  = System.Globalization.ComparatorInfo.GetInstance(System.Globalization.CultureInfo.CreateSpecificCulture("en"));
            SortedSet      props  = new SortedSet(order);
            SortedSet      values = new SortedSet(order);
            BagFormatter   bf     = new BagFormatter();

            ILOG.J2CsMapping.Collections.Generics.Collections.AddAll(ups.GetAvailableNames(), props);
            for (int i = IBM.ICU.Charset.UnicodeProperty.BINARY; i < IBM.ICU.Charset.UnicodeProperty.LIMIT_TYPE; ++i)
            {
                System.Console.Out.WriteLine(IBM.ICU.Charset.UnicodeProperty.GetTypeName(i));
                IIterator it = new ILOG.J2CsMapping.Collections.IteratorAdapter(props.GetEnumerator());
                while (it.HasNext())
                {
                    String          propAlias = (String)it.Next();
                    UnicodeProperty up        = ups.GetProperty(propAlias);
                    int             type      = up.GetType();
                    if (type != i)
                    {
                        continue;
                    }
                    System.Console.Out.WriteLine();
                    System.Console.Out.WriteLine(propAlias + "\t"
                                                 + bf.Join(up.GetNameAliases()));
                    if (!showValues)
                    {
                        continue;
                    }
                    ILOG.J2CsMapping.Collections.Collections.Clear(values);
                    if (type == IBM.ICU.Charset.UnicodeProperty.NUMERIC ||
                        type == IBM.ICU.Charset.UnicodeProperty.EXTENDED_NUMERIC)
                    {
                        UnicodeMap um = new UnicodeMap();
                        um.PutAll(up);
                        System.Console.Out.WriteLine(um.ToString(new TestBagFormatter.NumberComparator()));
                        continue;
                    }
                    ILOG.J2CsMapping.Collections.Collections.Clear(values);
                    ILOG.J2CsMapping.Collections.Generics.Collections.AddAll(up.GetAvailableValues(), values);
                    IIterator it2 = new ILOG.J2CsMapping.Collections.IteratorAdapter(values.GetEnumerator());
                    while (it2.HasNext())
                    {
                        String valueAlias = (String)it2.Next();
                        System.Console.Out.WriteLine("\t"
                                                     + bf.Join(valueAlias + "\t"
                                                               + up.GetValueAliases(valueAlias)));
                    }
                }
            }
        }
Пример #2
0
 protected void addToDupes(string aPath)
 {
     if (aborted)
     {
         return;
     }
     ComparatorInfo o = new ComparatorInfo(aPath);
     lock (Watcher.hashes)
     {
         if (!Watcher.hashes.ContainsKey(o))
         {
             Watcher.hashes.Add(o, true);
         }
         else
         {
             hardDelete(aPath, "dupe");
         }
     }
 }