Inheritance: global::java.util.AbstractSet, global::java.util.Set, global::java.lang.Cloneable, global::java.io.Serializable
 static BytecodeHelper() {
     IterableOrIteratorElementTypes = new HashMap<String, TypeKind>();
     IterableOrIteratorElementTypes["stab/lang/BooleanIterable"] = TypeKind.Boolean;
     IterableOrIteratorElementTypes["stab/lang/BooleanIterator"] = TypeKind.Boolean;
     IterableOrIteratorElementTypes["stab/lang/ByteIterable"] = TypeKind.Byte;
     IterableOrIteratorElementTypes["stab/lang/ByteIterator"] = TypeKind.Byte;
     IterableOrIteratorElementTypes["stab/lang/ShortIterable"] = TypeKind.Short;
     IterableOrIteratorElementTypes["stab/lang/ShortIterator"] = TypeKind.Short;
     IterableOrIteratorElementTypes["stab/lang/CharIterable"] = TypeKind.Char;
     IterableOrIteratorElementTypes["stab/lang/CharIterator"] = TypeKind.Char;
     IterableOrIteratorElementTypes["stab/lang/IntIterable"] = TypeKind.Int;
     IterableOrIteratorElementTypes["stab/lang/IntIterator"] = TypeKind.Int;
     IterableOrIteratorElementTypes["stab/lang/LongIterable"] = TypeKind.Long;
     IterableOrIteratorElementTypes["stab/lang/LongIterator"] = TypeKind.Long;
     IterableOrIteratorElementTypes["stab/lang/FloatIterable"] = TypeKind.Float;
     IterableOrIteratorElementTypes["stab/lang/FloatIterator"] = TypeKind.Float;
     IterableOrIteratorElementTypes["stab/lang/DoubleIterable"] = TypeKind.Double;
     IterableOrIteratorElementTypes["stab/lang/DoubleIterator"] = TypeKind.Double;
     
     IterableTypes = new HashSet<String>();
     IterableTypes.add("stab/lang/BooleanIterable");
     IterableTypes.add("stab/lang/ByteIterable");
     IterableTypes.add("stab/lang/ShortIterable");
     IterableTypes.add("stab/lang/CharIterable");
     IterableTypes.add("stab/lang/IntIterable");
     IterableTypes.add("stab/lang/LongIterable");
     IterableTypes.add("stab/lang/FloatIterable");
     IterableTypes.add("stab/lang/DoubleIterable");
     IterableTypes.add("java/lang/Iterable");
 }
        // A set of all country codes for which data is available.
        internal static Set<Integer> getCountryCodeSet()
        {
            // The capacity is set to 34 as there are 26 different entries,
            // and this offers a load factor of roughly 0.75.
            Set<Integer> countryCodeSet = new HashSet<Integer>(34);

            countryCodeSet.add(7);
            countryCodeSet.add(30);
            countryCodeSet.add(31);
            countryCodeSet.add(34);
            countryCodeSet.add(43);
            countryCodeSet.add(44);
            countryCodeSet.add(49);
            countryCodeSet.add(55);
            countryCodeSet.add(58);
            countryCodeSet.add(61);
            countryCodeSet.add(62);
            countryCodeSet.add(63);
            countryCodeSet.add(81);
            countryCodeSet.add(90);
            countryCodeSet.add(351);
            countryCodeSet.add(352);
            countryCodeSet.add(359);
            countryCodeSet.add(372);
            countryCodeSet.add(373);
            countryCodeSet.add(375);
            countryCodeSet.add(380);
            countryCodeSet.add(385);
            countryCodeSet.add(595);
            countryCodeSet.add(855);
            countryCodeSet.add(971);
            countryCodeSet.add(972);

            return countryCodeSet;
        }
		public Iterable<String> getAllReferencingTypes(Iterable<String> typeNames) {
			var result = new HashSet<String>();
			foreach (var t in typeNames) {
				visitReferencingTypes(t, result);
			}
			return result;
		}
		/**
		 * Locate the triangle with point (a Pnt) inside (or on) it.
		 * @param point the Pnt to locate
		 * @return triangle (Simplex<Pnt>) that holds the point; null if no such triangle
		 */
		public Simplex locate(Pnt point) {
        Simplex triangle = mostRecent;
        if (!this.contains(triangle)) triangle = null;
        
        // Try a directed walk (this works fine in 2D, but can fail in 3D)
        Set visited = new HashSet();
        while (triangle != null) {
            if (visited.contains(triangle)) { // This should never happen
                Console.WriteLine("Warning: Caught in a locate loop");
                break;
            }
            visited.add(triangle);
            // Corner opposite point
            Pnt corner = point.isOutside((Pnt[]) triangle.toArray(new Pnt[0]));
            if (corner == null) return triangle;
            triangle = this.neighborOpposite(corner, triangle);
        }
        // No luck; try brute force
        Console.WriteLine("Warning: Checking all triangles for " + point);
        for (Iterator it = this.iterator(); it.hasNext();) {
            Simplex tri = (Simplex) it.next();
            if (point.isOutside((Pnt[]) tri.toArray(new Pnt[0])) == null) return tri;
        }
        // No such triangle
		Console.WriteLine("Warning: No triangle holds " + point);
        return null;
    }
Esempio n. 5
0
        public WrapperRepository(Assembly targetAssembly)
        {
            this.translations = new Dictionary<string, string>
            {
                { "com.gargoylesoftware.htmlunit.", "" },
                { "org.w3c.dom.", "W3C.Dom." },
            };

            Settings.Default.Whaat = new Random().Next().ToString();
            Settings.Default.Save();

            UsedTypes = new HashSet<Type>();
            CompleteTypes = new Dictionary<Type, WrapperClassInfo>();
            TargetAssembly = targetAssembly;

            if (Settings.Default.ListTypes != null)
            {
                ListTypes =
                    Settings.Default.ListTypes.Cast<string>()
                        .Where(s => s.Contains(':'))
                        .ToDictionary(
                            s => s.Substring(0, s.IndexOf(':')),
                            s => s.Substring(s.IndexOf(':') + 1));
            }
            else
            {
                ListTypes = new Dictionary<string, string>();
                Settings.Default.ListTypes = new StringCollection();
            }
        }
 public Set keySet()
 {
     var s = new HashSet();
     foreach (var k in c.AllKeys)
         s.add(k);
     return s;
 }
Esempio n. 7
0
 public override double stringDistance(String stringA, String stringB)
 {
     HashSet<string> ha = new HashSet<string>();
     HashSet<string> hb = new HashSet<string>();
     long pos = ms.Position;
     tw.WriteLine(stringA);
     tw.Flush();
     ms.Position = pos;
     Lucene.Net.Analysis.Token t = filt.Next();
     while (t != null) {
         ha.Add(t.TermText());
         t = filt.Next();
     }
     pos = ms.Position;
     tw.WriteLine(stringB);
     tw.Flush();
     ms.Position = pos;
     Lucene.Net.Analysis.Token tb = filt.Next();
     while (tb != null) {
         hb.Add(tb.TermText());
         tb = filt.Next();
     }
     double uc = ha.Union(hb).Count();
     double ic = ha.Intersect(hb).Count();
     return (uc - ic) / uc;
 }
Esempio n. 8
0
		public static bool moreInfo = false; // True iff more info in toString

		/**
		 * Constructor.
		 * @param collection a Collection holding the Simplex vertices
		 * @throws IllegalArgumentException if there are duplicate vertices
		 */
		public Simplex(Collection collection)
		{
			this.vertices = Collections.unmodifiableList(new java.util.ArrayList(collection));
			this.idNumber = idGenerator++;
			Set noDups = new HashSet(this);
			if (noDups.size() != this.vertices.size())
				throw new InvalidOperationException("Duplicate vertices in Simplex");
		}
 public Set entrySet()
 {
     var s = new HashSet();
     foreach (string k in c) {
         var entry = new MapEntry(k, c.GetValues(k));
         s.add(entry);
     }
     return s;
 }
Esempio n. 10
0
		/**
		 * Report the facets of this Simplex.
		 * Each facet is a set of vertices.
		 * @return an Iterable for the facets of this Simplex
		 */
		public List facets()
		{
			List theFacets = new java.util.LinkedList();
			for (Iterator it = this.iterator(); it.hasNext(); )
			{
				Object v = it.next();
				Set facet = new HashSet(this);
				facet.remove(v);
				theFacets.add(facet);
			}
			return theFacets;
		}
		public void addFileToTypeRelation(String fileName, String typeName) {
			var contents = fileContents.get(fileName);
			if (contents == null) {
				contents = new HashSet<String>();
				fileContents[fileName] = contents;
			}
			contents.add(typeName);
			var locations = typeLocations.get(typeName);
			if (locations == null) {
				locations = new HashSet<String>();
				typeLocations[typeName] = locations;
			}
			locations.add(fileName);
		}
		public void addTypeToTypeRelation(String referencingType, String referencedType) {
			var referencing = referencingTypes.get(referencedType);
			if (referencing == null) {
				referencing = new HashSet<String>();
				referencingTypes[referencedType] = referencing;
			}
			referencing.add(referencingType);
			var referenced = referencedTypes.get(referencingType);
			if (referenced == null) {
				referenced = new HashSet<String>();
				referencedTypes[referencingType] = referenced;
			}
			referenced.add(referencedType);
		}
Esempio n. 13
0
        public virtual Set getCacheIds(Class cls)
        {
            SparseArray l2 = (SparseArray)sWindows.get(cls);
            if (l2 == null)
            {
                return new HashSet();
            }

            Set keys = new HashSet();
            for (int i = 0; i < l2.size(); i++)
            {
                keys.add(l2.keyAt(i));
            }
            return keys;
        }
 public DefaultTableXYDataset(bool autoPrune)
 {
   int num = autoPrune ? 1 : 0;
   // ISSUE: explicit constructor call
   base.\u002Ector();
   DefaultTableXYDataset defaultTableXyDataset = this;
   this.data = (List) null;
   this.xPoints = (HashSet) null;
   this.propagateEvents = true;
   this.autoPrune = false;
   this.autoPrune = num != 0;
   this.data = (List) new ArrayList();
   this.xPoints = new HashSet();
   this.intervalDelegate = new IntervalXYDelegate((XYDataset) this, false);
   this.addChangeListener((DatasetChangeListener) this.intervalDelegate);
 }
		/**
		 * Place a new point site into the DT.
		 * @param site the new Pnt
		 * @return set of all new triangles created
		 */
		public Set delaunayPlace(Pnt site) {
        Set newTriangles = new HashSet();
        Set oldTriangles = new HashSet();
        Set doneSet = new HashSet();
        LinkedList waitingQ = new LinkedList();
        
        // Locate containing triangle
        if (debug) Console.WriteLine("Locate");
        Simplex triangle = locate(site);
        
        // Give up if no containing triangle or if site is already in DT
		var triangle_null = triangle == null;
        if (triangle_null || triangle.contains(site)) return newTriangles;
        
        // Find Delaunay cavity (those triangles with site in their circumcircles)
        if (debug) Console.WriteLine("Cavity");
        waitingQ.add(triangle);
        while (!waitingQ.isEmpty()) {
            triangle = (Simplex) waitingQ.removeFirst();      
            if (site.vsCircumcircle((Pnt[]) triangle.toArray(new Pnt[0])) == 1) continue;
            oldTriangles.add(triangle);
            Iterator it = this.neighbors(triangle).iterator();
            for (; it.hasNext();) {
                Simplex tri = (Simplex) it.next();
                if (doneSet.contains(tri)) continue;
                doneSet.add(tri);
                waitingQ.add(tri);
            }
        }
        // Create the new triangles
        if (debug) Console.WriteLine("Create");
        for (Iterator it = Simplex.boundary(oldTriangles).iterator(); it.hasNext();) {
            Set facet = (Set) it.next();
            facet.add(site);
            newTriangles.add(new Simplex(facet));
        }
        // Replace old triangles with new triangles
		if (debug) Console.WriteLine("Update");
        this.update(oldTriangles, newTriangles);
        
        // Update mostRecent triangle
        if (!newTriangles.isEmpty()) mostRecent = (Simplex) newTriangles.iterator().next();
        return newTriangles;
    }
 /**
    * Supports Java Serialization.
    */
 public override void readExternal(ObjectInput objectInput)
 {
     numOfEntries = objectInput.readInt();
     if (countryCallingCodes == null || countryCallingCodes.Length < numOfEntries) {
       countryCallingCodes = new int[numOfEntries];
     }
     if (availableLanguages == null) {
       availableLanguages = new ArrayList<Set<String>>();
     }
     for (int i = 0; i < numOfEntries; i++) {
       countryCallingCodes[i] = objectInput.readInt();
       int numOfLangs = objectInput.readInt();
       Set<String> setOfLangs = new HashSet<String>();
       for (int j = 0; j < numOfLangs; j++) {
     setOfLangs.add(objectInput.readUTF());
       }
       availableLanguages.add(setOfLangs);
     }
 }
		public bool load(IFile file) {
			if (file.exists()) {
				try {
					var libraries = new ArrayList<ProjectLibrary>();
					var preprocessorSymbols = new HashSet<String>();
					var outputPath = "bin";
					
					var document = XmlHelper.load(new InputStreamReader(file.getContents()));
					var nodeList = document.getElementsByTagName("library");
					int length = nodeList.getLength();
					for (int i = 0; i < length; i++) {
						var e = (Element)nodeList.item(i);
						var lib = new ProjectLibrary(e.getAttribute("name"));
						var enabled = e.getAttribute("enabled");
						lib.setEnabled(enabled.length() == 0 || !enabled.equals("false"));
						libraries.add(lib);
					}
					nodeList = document.getElementsByTagName("preprocessorSymbols");
					if (nodeList.getLength() == 1) {
						foreach (var s in nodeList.item(0).getTextContent().split(";")) {
							preprocessorSymbols.add(s.trim());
						}
					}
					nodeList = document.getElementsByTagName("outputPath");
					if (nodeList.getLength() == 1) {
						outputPath = nodeList.item(0).getTextContent();
					}
					this.Libraries = libraries;
					this.PreprocessorSymbols = preprocessorSymbols;
					this.OutputPath = outputPath;
					return true;
				} catch (Exception e) {
					Environment.logException(e);
				}
			}
			this.Libraries = Query.empty<ProjectLibrary>();
			this.PreprocessorSymbols = Query.empty<String>();
			return false;
		}
		public static Iterable<IFile> getModifiedFiles(IResourceDelta delta, Iterable<String> extensions, Iterable<String> excludedFolders) {
			var result = new HashSet<IFile>();
			try {
				delta.accept(p => {
					var resource = p.getResource();
					switch (resource.getType()) {
					case IResource.FOLDER:
						return !excludedFolders.contains(resource.getProjectRelativePath().toPortableString());
					case IResource.FILE:
						var file = (IFile)resource;
						if (extensions.contains(file.getFileExtension())) {
							//if ((p.getFlags() & IResourceDelta.CONTENT) != 0 || (p.getFlags() & IResourceDelta.MARKERS) == 0) {
							result.add(file);
							//}
						}
						return false;
					}
					return true;
				});
			} catch (CoreException e) {
				Environment.logException(e);
			}
			return result;
		}
		public TypeBuilder[] getDependencies() {
            checkCreated();
			var dependencies = new HashSet<TypeBuilder>();
			addType(dependencies, baseType);
			foreach (var t in interfaces) {
				addType(dependencies, t);
			}
            foreach (var a in annotations) {
				addType(dependencies, a.Type);
			}
            foreach (var nt in nestedTypes) {
				foreach (var t in ((TypeBuilder)nt).getDependencies()) {
					dependencies.add((TypeBuilder)t);
				}
			}
			foreach (var f in fields) {
				foreach (var a in f.Annotations) {
					addType(dependencies, a.Type);
				}
				addType(dependencies, f.Type);
			}
            foreach (var m in methods) {
                if (!m.IsExcludedFromCompilation) {
					foreach (var a in m.Annotations) {
						addType(dependencies, a.Type);
					}
					addType(dependencies, m.ReturnType);
					foreach (var p in m.Parameters) {
						foreach (var a in p.Annotations) {
							addType(dependencies, a.Type);
						}
						addType(dependencies, p.Type);
					}
					foreach (var e in m.Exceptions) {
						addType(dependencies, e);
					}
					foreach (var instruction in ((MethodBuilder)m).CodeGenerator.Instructions) {
						switch (instruction.Opcode) {
						case Getfield:
						case Getstatic:
						case Putfield:
						case Putstatic:
							addType(dependencies, instruction.Field.DeclaringType);
							break;
							
						case Invokedynamic:
						case Invokeinterface:
						case Invokespecial:
						case Invokestatic:
						case Invokevirtual:
							addType(dependencies, instruction.Method.DeclaringType);
							break;
						case Anewarray:
						case Checkcast:
						case Instanceof:
						case New:
							addType(dependencies, instruction.Type);
							break;
						}
					}
				}
			}
			return dependencies.toArray(new TypeBuilder[dependencies.size()]);
		}
Esempio n. 20
0
		/**
		 * Report the boundary of a Set of Simplices.
		 * The boundary is a Set of facets where each facet is a Set of vertices.
		 * @return an Iterator for the facets that make up the boundary
		 */
		public static Set boundary(Set simplexSet)
		{
			Set theBoundary = new HashSet();
			for (Iterator it = simplexSet.iterator(); it.hasNext(); )
			{
				Simplex simplex = (Simplex)it.next();
				for (Iterator otherIt = simplex.facets().iterator(); otherIt.hasNext(); )
				{
					Set facet = (Set)otherIt.next();
					if (theBoundary.contains(facet)) theBoundary.remove(facet);
					else theBoundary.add(facet);
				}
			}
			return theBoundary;
		}
Esempio n. 21
0
 public virtual LegendItemCollection getLegendCollection()
 {
   LegendItemCollection legendItemCollection = new LegendItemCollection();
   if (this.paintIndex != null && this.paintIndex.size() > 0)
   {
     if (this.paintIndex.size() <= this.paintLimit)
     {
       Iterator iterator = this.paintIndex.entrySet().iterator();
       while (iterator.hasNext())
       {
         Map.Entry entry = (Map.Entry) iterator.next();
         string label = Object.instancehelper_toString(entry.getKey());
         string description = label;
         Rectangle2D.Double @double = new Rectangle2D.Double(1.0, 1.0, 1.0, 1.0);
         Paint fillPaint = this.lookupSeriesPaint(((Integer) entry.getValue()).intValue());
         Color color = (Color) Color.black;
         Stroke outlineStroke = AbstractRenderer.__\u003C\u003EDEFAULT_STROKE;
         legendItemCollection.add(new LegendItem(label, description, (string) null, (string) null, (Shape) @double, fillPaint, outlineStroke, (Paint) color));
       }
     }
     else
     {
       HashSet hashSet = new HashSet();
       Iterator iterator = this.paintIndex.entrySet().iterator();
       while (iterator.hasNext())
       {
         Map.Entry entry = (Map.Entry) iterator.next();
         if (((Set) hashSet).add(entry.getValue()))
         {
           string label = new StringBuffer().append(Object.instancehelper_toString((object) this.getMinPaintValue((Integer) entry.getValue()))).append(" - ").append(Object.instancehelper_toString((object) this.getMaxPaintValue((Integer) entry.getValue()))).toString();
           string description = label;
           Rectangle2D.Double @double = new Rectangle2D.Double(1.0, 1.0, 1.0, 1.0);
           Paint seriesPaint = this.getSeriesPaint(((Integer) entry.getValue()).intValue());
           Color color = (Color) Color.black;
           Stroke outlineStroke = AbstractRenderer.__\u003C\u003EDEFAULT_STROKE;
           legendItemCollection.add(new LegendItem(label, description, (string) null, (string) null, (Shape) @double, seriesPaint, outlineStroke, (Paint) color));
         }
       }
     }
   }
   return legendItemCollection;
 }
Esempio n. 22
0
        protected void DoJs(string modulePath, string moduleName)
        {
            var jsFiles = new List<string>();
            ScanDir(new DirectoryInfo(modulePath),"*.js",ref jsFiles);
            FileStream file = new FileStream(_pathBuild+"/"+moduleName+".js",FileMode.Create);

            // Буфер для хранения принятых от клиента данных
            byte[] buffer = new byte[1024];
            // Переменная для хранения количества байт, принятых от клиента
            int Count;

            foreach (string jsFile in jsFiles )
            {
                Compiler compiler = new Compiler();
                CompilerOptions options = new CompilerOptions();
                //options.removeDeadCode = true;
                //options.removeUnusedLocalVars = true;
                //options.inlineFunctions = true;
                Set set = new HashSet();
                set.add("console");
                options.setStripTypes(set);

                var dummy = JSSourceFile.fromCode(_pathBuild+"/tmp" + ".wcjs", "");
                var source = JSSourceFile.fromFile(jsFile);
                var result = compiler.compile(dummy, source, options);
                String str = compiler.toSource();
                //totaljs += str;
                //Console.WriteLine(str);

                buffer = Encoding.UTF8.GetBytes(str);
                file.Write(buffer,0,buffer.Length);
                Console.WriteLine(jsFile);
            }
            file.Close();
        }
 private static Iterable<MemberInfo> filterMembers(Library typeSystem, TypeInfo scope, Iterable<MemberInfo> members) {
     HashSet<MemberInfo> exclude = null;
     foreach (var mi in members) {
         if (exclude != null && exclude.contains(mi)) {
             continue;
         }
         if (!scope.canAccessMember(mi.DeclaringType, mi.IsPublic, mi.IsProtected, mi.IsPrivate)) {
             continue;
         }
         if (mi.isOverridingMembers(typeSystem)) {
             foreach (var m in mi.getOverridenMembers(typeSystem)) {
                 if (exclude == null) {
                     exclude = new HashSet<MemberInfo>();
                 }
                 exclude.add(m);
             }
         }
         yield return mi;
     }
 }
Esempio n. 24
0
        private void SubsetFontFile(string subsetString, java.io.File paramFile1, java.io.File paramFile2)
        {
            FontFactory localFontFactory = FontFactory.getInstance();

            java.io.FileInputStream localFileInputStream = null;
            try
            {
                localFileInputStream = new java.io.FileInputStream(paramFile1);
                byte[] arrayOfByte = new byte[(int)paramFile1.length()];
                localFileInputStream.read(arrayOfByte);
                Font[] arrayOfFont = null;
                arrayOfFont = localFontFactory.loadFonts(arrayOfByte);
                Font localFont1 = arrayOfFont[0];
                java.util.ArrayList localArrayList = new java.util.ArrayList();
                localArrayList.add(CMapTable.CMapId.WINDOWS_BMP);
                //java.lang.Object localObject1 = null;
                java.lang.Object localObject2 = null;

                Font             localFont2 = localFont1;
                java.lang.Object localObject3;
                if (subsetString != null)
                {
                    localObject2 = new RenumberingSubsetter(localFont2, localFontFactory);
                    ((Subsetter)localObject2).setCMaps(localArrayList, 1);
                    localObject3 = (java.lang.Object)GlyphCoverage.getGlyphCoverage(localFont1, subsetString);
                    ((Subsetter)localObject2).setGlyphs((java.util.List)localObject3);
                    var localHashSet = new java.util.HashSet();
                    localHashSet.add(java.lang.Integer.valueOf(SfntlyTag.GDEF));
                    localHashSet.add(java.lang.Integer.valueOf(SfntlyTag.GPOS));
                    localHashSet.add(java.lang.Integer.valueOf(SfntlyTag.GSUB));
                    localHashSet.add(java.lang.Integer.valueOf(SfntlyTag.kern));
                    localHashSet.add(java.lang.Integer.valueOf(SfntlyTag.hdmx));
                    localHashSet.add(java.lang.Integer.valueOf(SfntlyTag.vmtx));
                    localHashSet.add(java.lang.Integer.valueOf(SfntlyTag.VDMX));
                    localHashSet.add(java.lang.Integer.valueOf(SfntlyTag.LTSH));
                    localHashSet.add(java.lang.Integer.valueOf(SfntlyTag.DSIG));
                    localHashSet.add(java.lang.Integer.valueOf(SfntlyTag.intValue(new byte[] { 109, 111, 114, 116 })));
                    localHashSet.add(java.lang.Integer.valueOf(SfntlyTag.intValue(new byte[] { 109, 111, 114, 120 })));
                    ((Subsetter)localObject2).setRemoveTables(localHashSet);
                    localFont2 = ((Subsetter)localObject2).subset().build();
                }
                if (this.strip)
                {
                    localObject2 = new HintStripper(localFont2, localFontFactory);
                    localObject3 = new HashSet();
                    ((Set)localObject3).add(Integer.valueOf(Tag.fpgm));
                    ((Set)localObject3).add(Integer.valueOf(Tag.prep));
                    ((Set)localObject3).add(Integer.valueOf(Tag.cvt));
                    ((Set)localObject3).add(Integer.valueOf(Tag.hdmx));
                    ((Set)localObject3).add(Integer.valueOf(Tag.VDMX));
                    ((Set)localObject3).add(Integer.valueOf(Tag.LTSH));
                    ((Set)localObject3).add(Integer.valueOf(Tag.DSIG));
                    ((Subsetter)localObject2).setRemoveTables((Set)localObject3);
                    localFont2 = ((Subsetter)localObject2).subset().build();
                }
                localObject2 = new java.io.FileOutputStream(paramFile2);
                if (this.woff)
                {
                    localObject3 = new WoffWriter().convert(localFont2);
                    ((WritableFontData)localObject3).copyTo((OutputStream)localObject2);
                }
                else if (this.eot)
                {
                    localObject3 = new EOTWriter(this.mtx).convert(localFont2);
                    ((WritableFontData)localObject3).copyTo((OutputStream)localObject2);
                }
                else
                {
                    localFontFactory.serializeFont(localFont2, (OutputStream)localObject2);
                }
            }
            catch (System.Exception ex)
            {
                throw new System.Exception(ex.Message);
            }
        }
		private void addType(HashSet<TypeBuilder> types, TypeInfo type) {
			if (type instanceof TypeBuilder) {
				types.add((TypeBuilder)type);
			} else if (type.TypeKind == TypeKind.Array) {
				addType(types, type.ElementType);
			} else {
				foreach (var t in type.GenericArguments) {
					addType(types, t);
				}
			}
		}
Esempio n. 26
0
 public bool retainAll(java.util.Collection c)
 {
     JavaIteratorWrapper<dotSesame.Statement> stmtIter = new JavaIteratorWrapper<org.openrdf.model.Statement>(c.iterator());
     HashSet<Triple> retained = new HashSet<Triple>();
     bool changed = false;
     foreach (dotSesame.Statement stmt in stmtIter)
     {
         retained.Add(SesameConverter.FromSesame(stmt, this._mapping));
     }
     foreach (Triple t in this._g.Triples.ToList())
     {
         if (!retained.Contains(t))
         {
             changed = true;
             this._g.Retract(t);
         }
     }
     return changed;
 }
		private Set<MethodInfo> getExtensionMethods() {
			if (extensionMethodInfos == null) {
				var l = new HashSet<MethodInfo>();
				foreach (var info in getAllTypeInfos().where(
						p => BytecodeHelper.getAnnotations(annotatedTypeSystem, p.Type).any(a => BytecodeHelper.isStaticClass(a)))) {
					foreach (var m in info.Type.Methods.where(
							p => BytecodeHelper.getAnnotations(annotatedTypeSystem, p).any(a => BytecodeHelper.isExtensionMethod(a)))) {
						if (m.Parameters.any()) {
							l.add(m);
						}
					}
				}
				extensionMethodInfos = l;
			}
			return extensionMethodInfos;
		}
		private Set<MemberInfo> getAllTypeInfos() {
			if (allTypeInfos == null) {
				var l = new HashSet<MemberInfo>();
				var currentPackage = packageNames.aggregate("", (p, q) => p + q + "/");
				
				// Top level types
				foreach (var type in typeSystem.AllClassNames.where(p => p.indexOf('/') == -1)) {
					var info = MemberInfo.getInfo(typeSystem.getType(type));
					if (info.Type.PackageName.equals(currentPackage) || info.IsPublic) {
						l.add(info);
					}
				}
				
				// Types from enclosing packages
				var pkg = "";
				var classNames = typeSystem.AllClassNames;
				foreach (var name in packageNames) {
					pkg += name + "/";
					classNames = classNames.where(p => p.startsWith(pkg));
					foreach (var type in classNames.where(p => p.indexOf('/', pkg.length()) == -1)) {
						var info = MemberInfo.getInfo(typeSystem.getType(type));
						if (info.Type.PackageName.equals(currentPackage) || info.IsPublic) {
							l.add(info);
						}
					}
				}
				
				// Types from using directives
				foreach (var pinfo in packageInfos) {
					foreach (var name in pinfo.UsedPackages) {
						pkg = name + "/";
						foreach (var type in typeSystem.AllClassNames.where(p => p.startsWith(pkg) && p.indexOf('/', pkg.length()) == -1)) {
							var info = MemberInfo.getInfo(typeSystem.getType(type));
							if (info.Type.PackageName.equals(currentPackage) || info.IsPublic) {
								l.add(info);
							}
						}
					}
				}
				
				allTypeInfos = l;
			}
			return allTypeInfos;
		}
		public Iterable<String> getRootPackages() {
			var result = new HashSet<String>();
			foreach (var c in typeSystem.AllClassNames) {
				int idx = c.indexOf('/');
				if (idx != -1) {
					result.add(c.substring(0, idx));
				}
			}
			foreach (var pinfo in packageInfos) {
				foreach (var e in pinfo.PackageAliases.entrySet()) {
					result.add(e.Key);
				}
			}
			return result;
		}
        // A set of all region codes for which data is available.
        internal static Set<String> getRegionCodeSet()
        {
            // The capacity is set to 304 as there are 228 different entries,
            // and this offers a load factor of roughly 0.75.
            Set<String> regionCodeSet = new HashSet<String>(304);

            regionCodeSet.add("AC");
            regionCodeSet.add("AD");
            regionCodeSet.add("AE");
            regionCodeSet.add("AF");
            regionCodeSet.add("AG");
            regionCodeSet.add("AI");
            regionCodeSet.add("AL");
            regionCodeSet.add("AM");
            regionCodeSet.add("AO");
            regionCodeSet.add("AR");
            regionCodeSet.add("AS");
            regionCodeSet.add("AT");
            regionCodeSet.add("AU");
            regionCodeSet.add("AW");
            regionCodeSet.add("AX");
            regionCodeSet.add("AZ");
            regionCodeSet.add("BA");
            regionCodeSet.add("BB");
            regionCodeSet.add("BD");
            regionCodeSet.add("BE");
            regionCodeSet.add("BF");
            regionCodeSet.add("BG");
            regionCodeSet.add("BH");
            regionCodeSet.add("BI");
            regionCodeSet.add("BJ");
            regionCodeSet.add("BL");
            regionCodeSet.add("BM");
            regionCodeSet.add("BN");
            regionCodeSet.add("BO");
            regionCodeSet.add("BQ");
            regionCodeSet.add("BR");
            regionCodeSet.add("BS");
            regionCodeSet.add("BT");
            regionCodeSet.add("BW");
            regionCodeSet.add("BY");
            regionCodeSet.add("BZ");
            regionCodeSet.add("CA");
            regionCodeSet.add("CC");
            regionCodeSet.add("CH");
            regionCodeSet.add("CI");
            regionCodeSet.add("CK");
            regionCodeSet.add("CL");
            regionCodeSet.add("CM");
            regionCodeSet.add("CN");
            regionCodeSet.add("CO");
            regionCodeSet.add("CR");
            regionCodeSet.add("CU");
            regionCodeSet.add("CV");
            regionCodeSet.add("CW");
            regionCodeSet.add("CX");
            regionCodeSet.add("CY");
            regionCodeSet.add("CZ");
            regionCodeSet.add("DE");
            regionCodeSet.add("DJ");
            regionCodeSet.add("DK");
            regionCodeSet.add("DM");
            regionCodeSet.add("DO");
            regionCodeSet.add("DZ");
            regionCodeSet.add("EC");
            regionCodeSet.add("EE");
            regionCodeSet.add("EG");
            regionCodeSet.add("EH");
            regionCodeSet.add("ES");
            regionCodeSet.add("ET");
            regionCodeSet.add("FI");
            regionCodeSet.add("FJ");
            regionCodeSet.add("FK");
            regionCodeSet.add("FM");
            regionCodeSet.add("FO");
            regionCodeSet.add("FR");
            regionCodeSet.add("GA");
            regionCodeSet.add("GB");
            regionCodeSet.add("GD");
            regionCodeSet.add("GE");
            regionCodeSet.add("GF");
            regionCodeSet.add("GG");
            regionCodeSet.add("GH");
            regionCodeSet.add("GI");
            regionCodeSet.add("GL");
            regionCodeSet.add("GM");
            regionCodeSet.add("GP");
            regionCodeSet.add("GR");
            regionCodeSet.add("GT");
            regionCodeSet.add("GU");
            regionCodeSet.add("GW");
            regionCodeSet.add("GY");
            regionCodeSet.add("HK");
            regionCodeSet.add("HN");
            regionCodeSet.add("HR");
            regionCodeSet.add("HT");
            regionCodeSet.add("HU");
            regionCodeSet.add("ID");
            regionCodeSet.add("IE");
            regionCodeSet.add("IL");
            regionCodeSet.add("IM");
            regionCodeSet.add("IN");
            regionCodeSet.add("IR");
            regionCodeSet.add("IS");
            regionCodeSet.add("IT");
            regionCodeSet.add("JE");
            regionCodeSet.add("JM");
            regionCodeSet.add("JO");
            regionCodeSet.add("JP");
            regionCodeSet.add("KE");
            regionCodeSet.add("KG");
            regionCodeSet.add("KH");
            regionCodeSet.add("KI");
            regionCodeSet.add("KM");
            regionCodeSet.add("KN");
            regionCodeSet.add("KR");
            regionCodeSet.add("KW");
            regionCodeSet.add("KY");
            regionCodeSet.add("KZ");
            regionCodeSet.add("LA");
            regionCodeSet.add("LB");
            regionCodeSet.add("LC");
            regionCodeSet.add("LI");
            regionCodeSet.add("LK");
            regionCodeSet.add("LR");
            regionCodeSet.add("LS");
            regionCodeSet.add("LT");
            regionCodeSet.add("LU");
            regionCodeSet.add("LV");
            regionCodeSet.add("LY");
            regionCodeSet.add("MA");
            regionCodeSet.add("MC");
            regionCodeSet.add("MD");
            regionCodeSet.add("ME");
            regionCodeSet.add("MF");
            regionCodeSet.add("MG");
            regionCodeSet.add("MH");
            regionCodeSet.add("MK");
            regionCodeSet.add("ML");
            regionCodeSet.add("MM");
            regionCodeSet.add("MN");
            regionCodeSet.add("MO");
            regionCodeSet.add("MP");
            regionCodeSet.add("MQ");
            regionCodeSet.add("MR");
            regionCodeSet.add("MS");
            regionCodeSet.add("MT");
            regionCodeSet.add("MU");
            regionCodeSet.add("MV");
            regionCodeSet.add("MW");
            regionCodeSet.add("MX");
            regionCodeSet.add("MY");
            regionCodeSet.add("MZ");
            regionCodeSet.add("NA");
            regionCodeSet.add("NC");
            regionCodeSet.add("NF");
            regionCodeSet.add("NG");
            regionCodeSet.add("NI");
            regionCodeSet.add("NL");
            regionCodeSet.add("NO");
            regionCodeSet.add("NP");
            regionCodeSet.add("NR");
            regionCodeSet.add("NU");
            regionCodeSet.add("NZ");
            regionCodeSet.add("OM");
            regionCodeSet.add("PA");
            regionCodeSet.add("PE");
            regionCodeSet.add("PF");
            regionCodeSet.add("PG");
            regionCodeSet.add("PH");
            regionCodeSet.add("PK");
            regionCodeSet.add("PL");
            regionCodeSet.add("PM");
            regionCodeSet.add("PR");
            regionCodeSet.add("PT");
            regionCodeSet.add("PW");
            regionCodeSet.add("PY");
            regionCodeSet.add("QA");
            regionCodeSet.add("RE");
            regionCodeSet.add("RO");
            regionCodeSet.add("RS");
            regionCodeSet.add("RU");
            regionCodeSet.add("RW");
            regionCodeSet.add("SA");
            regionCodeSet.add("SB");
            regionCodeSet.add("SC");
            regionCodeSet.add("SD");
            regionCodeSet.add("SE");
            regionCodeSet.add("SG");
            regionCodeSet.add("SH");
            regionCodeSet.add("SI");
            regionCodeSet.add("SJ");
            regionCodeSet.add("SK");
            regionCodeSet.add("SL");
            regionCodeSet.add("SM");
            regionCodeSet.add("SR");
            regionCodeSet.add("ST");
            regionCodeSet.add("SV");
            regionCodeSet.add("SX");
            regionCodeSet.add("SY");
            regionCodeSet.add("SZ");
            regionCodeSet.add("TC");
            regionCodeSet.add("TD");
            regionCodeSet.add("TG");
            regionCodeSet.add("TH");
            regionCodeSet.add("TJ");
            regionCodeSet.add("TL");
            regionCodeSet.add("TM");
            regionCodeSet.add("TN");
            regionCodeSet.add("TO");
            regionCodeSet.add("TR");
            regionCodeSet.add("TT");
            regionCodeSet.add("TV");
            regionCodeSet.add("TW");
            regionCodeSet.add("TZ");
            regionCodeSet.add("UA");
            regionCodeSet.add("UG");
            regionCodeSet.add("US");
            regionCodeSet.add("UY");
            regionCodeSet.add("UZ");
            regionCodeSet.add("VA");
            regionCodeSet.add("VC");
            regionCodeSet.add("VE");
            regionCodeSet.add("VG");
            regionCodeSet.add("VI");
            regionCodeSet.add("VN");
            regionCodeSet.add("VU");
            regionCodeSet.add("WF");
            regionCodeSet.add("WS");
            regionCodeSet.add("YE");
            regionCodeSet.add("YT");
            regionCodeSet.add("ZA");
            regionCodeSet.add("ZM");
            regionCodeSet.add("ZW");

            return regionCodeSet;
        }
Esempio n. 31
0
		/**
		 * True iff simplices are neighbors.
		 * Two simplices are neighbors if they are the same dimension and they share
		 * a facet.
		 * @param simplex the other Simplex
		 * @return true iff this Simplex is a neighbor of simplex
		 */
		public bool isNeighbor(Simplex simplex)
		{
			HashSet h = new HashSet(this);
			h.removeAll(simplex);
			return (this.size() == simplex.size()) && (h.size() == 1);
		}