Example #1
0
	internal virtual void printDicationary()
	{
		  // Get a set of the entries
		  ISet<object> set = dictionary.entrySet();
		  // Get an iterator
		  System.Collections.IEnumerator i = set.GetEnumerator();
		  // Display elements
		  while (i.MoveNext())
		  {
			 System.Collections.IDictionary.Entry me = (System.Collections.IDictionary.Entry)i.Current;
			 Console.Write(((Sentence)me.Key).value + ": ");
			 Console.WriteLine(me.Value);
		  }
	}
        public override Iterator <Map.Entry <IteratorIndex, SimpleView> > getIterator()
        {
            LinkedHashMap <IteratorIndex, SimpleView> map
                = new LinkedHashMap <IteratorIndex, SimpleView>();

            for (int i = 0; i < _attrList.size(); i++)
            {
                SimpleView view = _attrList.get(i);

                map.put(IteratorIndex.create(view.getNodeName()), view);
            }

            return(map.entrySet().iterator());
        }
Example #3
0
        public virtual void addTexture(IRenderingEngine re, Texture texture)
        {
            int?    key             = getKey(texture.Addr, texture.ClutAddr, texture.ClutStart, texture.ClutMode);
            Texture previousTexture = cache.get(key);

            if (previousTexture != null)
            {
                previousTexture.deleteTexture(re);
//JAVA TO C# CONVERTER TODO TASK: There is no .NET LinkedList equivalent to the Java 'remove' method:
                vramTextures.remove(previousTexture);
            }
            else
            {
                // Check if the cache is not growing too large
                if (cache.size() >= cacheMaxSize)
                {
                    // Remove the LRU cache entry
                    IEnumerator <KeyValuePair <int, Texture> > it = cache.entrySet().GetEnumerator();
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
                    if (it.hasNext())
                    {
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
                        KeyValuePair <int, Texture> entry = it.next();
                        Texture lruTexture = entry.Value;
                        lruTexture.deleteTexture(re);
//JAVA TO C# CONVERTER TODO TASK: There is no .NET LinkedList equivalent to the Java 'remove' method:
                        vramTextures.remove(lruTexture);
//JAVA TO C# CONVERTER TODO TASK: .NET enumerators are read-only:
                        it.remove();

                        statistics.entriesRemoved++;
                    }
                }
            }

            cache.put(key, texture);
            if (isVramTexture(texture))
            {
                vramTextures.AddLast(texture);
            }

            if (cache.size() > statistics.maxSizeUsed)
            {
                statistics.maxSizeUsed = cache.size();
            }
        }
Example #4
0
 internal virtual TypeParameter[] TypeParameters()
 {
     if (TypeParametersConflict == null)
     {
         return(TypeParameter.NoParameters);
     }
     else
     {
         TypeParameter[] result = new TypeParameter[TypeParametersConflict.size()];
         int             i      = 0;
         foreach (KeyValuePair <string, TypeReference.Bound> entry in TypeParametersConflict.entrySet())
         {
             result[i++] = new TypeParameter(entry.Key, entry.Value);
         }
         return(result);
     }
 }
Example #5
0
        public virtual void addVertex(IRenderingEngine re, VertexInfo vertexInfo, int numberOfVertex, float[][] boneMatrix, int numberOfWeightsForShader)
        {
            lock (this)
            {
                int?       key            = getKey(vertexInfo);
                VertexInfo previousVertex = cache.get(key);
                if (previousVertex != null)
                {
                    vertexInfo.reuseCachedBuffer(previousVertex);
                    previousVertex.deleteVertex(re);
                }
                else
                {
                    // Check if the cache is not growing too large
                    if (cache.size() >= cacheMaxSize)
                    {
                        // Remove the LRU cache entry
                        IEnumerator <KeyValuePair <int, VertexInfo> > it = cache.entrySet().GetEnumerator();
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
                        if (it.hasNext())
                        {
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
                            KeyValuePair <int, VertexInfo> entry = it.next();
                            entry.Value.deleteVertex(re);
//JAVA TO C# CONVERTER TODO TASK: .NET enumerators are read-only:
                            it.remove();

                            statistics.entriesRemoved++;
                        }
                    }
                }

                vertexInfo.prepareForCache(this, numberOfVertex, boneMatrix, numberOfWeightsForShader);
                cache.put(key, vertexInfo);

                if (cache.size() > statistics.maxSizeUsed)
                {
                    statistics.maxSizeUsed = cache.size();
                }
            }
        }
        public override Set <Map.Entry <Value, Value> > getEntrySet(Env env, QuercusClass cls)
        {
            LinkedHashMap <Value, Value> map
                = new LinkedHashMap <Value, Value>();

            if (_attrList.size() > 0)
            {
                ArrayValue array = new ArrayValueImpl();

                for (AttributeView view : _attrList)
                {
                    string name  = view.getNodeName();
                    string value = view.getNodeValue();

                    array.put(env.createString(name),
                              env.createString(value));
                }

                map.put(env.createString("@attributes"), array);
            }

            return(map.entrySet());
        }