当前位置: 首页>>代码示例>>Java>>正文


Java Dictionary.keys方法代码示例

本文整理汇总了Java中java.util.Dictionary.keys方法的典型用法代码示例。如果您正苦于以下问题:Java Dictionary.keys方法的具体用法?Java Dictionary.keys怎么用?Java Dictionary.keys使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.util.Dictionary的用法示例。


在下文中一共展示了Dictionary.keys方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getHighestValue

import java.util.Dictionary; //导入方法依赖的package包/类
/**
 * Returns the biggest value that has an entry in the label table.
 *
 * @return biggest value that has an entry in the label table, or
 *         null.
 * @since 1.6
 */
protected Integer getHighestValue() {
    @SuppressWarnings("rawtypes")
    Dictionary dictionary = slider.getLabelTable();

    if (dictionary == null) {
        return null;
    }

    Enumeration<?> keys = dictionary.keys();

    Integer max = null;

    while (keys.hasMoreElements()) {
        Integer i = (Integer) keys.nextElement();

        if (max == null || i > max) {
            max = i;
        }
    }

    return max;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:30,代码来源:BasicSliderUI.java

示例2: addSuffixToSliderLabels

import java.util.Dictionary; //导入方法依赖的package包/类
public static void addSuffixToSliderLabels(JSlider slider, String suffix) {

        assert (slider != null && suffix != null);

        Dictionary oldLabels = slider.getLabelTable();
        Enumeration oldKeys = oldLabels.keys();
        Hashtable newLabelTable = new Hashtable();
        while (oldKeys.hasMoreElements()) {
            Object key = oldKeys.nextElement();
            Object value = oldLabels.get(key);
            assert (value instanceof String);
            String str = ((String)value).concat(suffix);
            JLabel label = new JLabel(str);
            newLabelTable.put(key, label);
        }

        slider.setLabelTable(newLabelTable);
    }
 
开发者ID:berniejenny,项目名称:MapAnalyst,代码行数:19,代码来源:SliderUtils.java

示例3: equals

import java.util.Dictionary; //导入方法依赖的package包/类
private boolean equals(Dictionary<String, ?> d1, Dictionary<String, ?> d2) {
    if (d1 == d2) {
        return true;
    } else if (d1 == null ^ d2 == null) {
        return false;
    } else if (d1.size() != d2.size()) {
        return false;
    } else {
        for (Enumeration<String> e1 = d1.keys(); e1.hasMoreElements();) {
            String key = e1.nextElement();
            Object v1 = d1.get(key);
            Object v2 = d2.get(key);
            if (v1 != v2 && (v2 == null || !v2.equals(v1))) {
                return false;
            }
        }
        return true;
    }
}
 
开发者ID:ops4j,项目名称:org.ops4j.pax.transx,代码行数:20,代码来源:AbstractActivator.java

示例4: sendHeaders

import java.util.Dictionary; //导入方法依赖的package包/类
/**
 * send the headers for the given connection based on the given Dictionary of headers
 * @param connection
 * @param headers
 */
private void sendHeaders( URLConnection connection, Dictionary headers ) {
		boolean sendReferer = getClientProperties().isSendReferer();
    for (Enumeration e = headers.keys(); e.hasMoreElements();) {
        String key = (String) e.nextElement();
        if ( sendReferer || !"referer".equalsIgnoreCase( key ) ) {
         connection.setRequestProperty( key, (String) headers.get( key ) );
         if (HttpUnitOptions.isLoggingHttpHeaders()) {
             if (key.equalsIgnoreCase( "authorization" ) || key.equalsIgnoreCase( "proxy-authorization") ) {
                 System.out.println( "Sending:: " + key + ": " + headers.get( key ) );
             } else {
                 System.out.println( "Sending:: " + key + ": " + connection.getRequestProperty( key ) );
             }
         }
    		} else if (HttpUnitOptions.isLoggingHttpHeaders()) {
    				System.out.println( "Blocked sending referer:: "+ connection.getRequestProperty( key ) );
    		}		
    } // for
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:24,代码来源:WebConversation.java

示例5: loadExistingValues

import java.util.Dictionary; //导入方法依赖的package包/类
private void loadExistingValues(String componentName) {
    try {
        Configuration cfg = cfgAdmin.getConfiguration(componentName, null);
        Map<String, ConfigProperty> map = properties.get(componentName);
        Dictionary<String, Object> props = cfg.getProperties();
        if (props != null) {
            Enumeration<String> it = props.keys();
            while (it.hasMoreElements()) {
                String name = it.nextElement();
                ConfigProperty p = map.get(name);
                if (p != null) {
                    map.put(name, ConfigProperty.setProperty(p, (String) props.get(name)));
                }
            }
        }
    } catch (IOException e) {
        log.error("Unable to get configuration for " + componentName, e);
    }

}
 
开发者ID:shlee89,项目名称:athena,代码行数:21,代码来源:ComponentConfigManager.java

示例6: getLowestValue

import java.util.Dictionary; //导入方法依赖的package包/类
/**
 * Returns the smallest value that has an entry in the label table.
 *
 * @return smallest value that has an entry in the label table, or
 *         null.
 * @since 1.6
 */
protected Integer getLowestValue() {
    Dictionary dictionary = slider.getLabelTable();

    if (dictionary == null) {
        return null;
    }

    Enumeration keys = dictionary.keys();

    Integer min = null;

    while (keys.hasMoreElements()) {
        Integer i = (Integer) keys.nextElement();

        if (min == null || i < min) {
            min = i;
        }
    }

    return min;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:29,代码来源:BasicSliderUI.java

示例7: getHighestValue

import java.util.Dictionary; //导入方法依赖的package包/类
/**
 * Returns the biggest value that has an entry in the label table.
 *
 * @return biggest value that has an entry in the label table, or
 *         null.
 * @since 1.6
 */
protected Integer getHighestValue() {
    Dictionary dictionary = slider.getLabelTable();

    if (dictionary == null) {
        return null;
    }

    Enumeration keys = dictionary.keys();

    Integer max = null;

    while (keys.hasMoreElements()) {
        Integer i = (Integer) keys.nextElement();

        if (max == null || i > max) {
            max = i;
        }
    }

    return max;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:29,代码来源:BasicSliderUI.java

示例8: LazyPropertyMap

import java.util.Dictionary; //导入方法依赖的package包/类
protected LazyPropertyMap(Dictionary dict) {
    super(5);

    Enumeration en = dict.keys();
    while (en.hasMoreElements()) {
        Object key = en.nextElement();
        super.put(key, dict.get(key));
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:BaseDocument.java

示例9: GenerateTermFrequency

import java.util.Dictionary; //导入方法依赖的package包/类
private void GenerateTermFrequency()
{
	for(int i=0; i < _numDocs  ; i++)
	{								
		String curDoc=_docs[i];
		Dictionary freq=GetWordFrequency(curDoc);
		Enumeration enums=freq.keys();
		
		while(enums.hasMoreElements()){
			String word=(String) enums.nextElement();
			int wordFreq=(Integer)freq.get(word);
			int termIndex=GetTermIndex(word);
                  if(termIndex == -1)
                      continue;
			_termFreq [termIndex][i]=wordFreq;
			_docFreq[termIndex] ++;

			if (wordFreq > _maxTermFreq[i]) _maxTermFreq[i]=wordFreq;	
		}
		//DictionaryEnumerator enums=freq.GetEnumerator() ;
		_maxTermFreq[i]=Integer.MIN_VALUE ;
		/*freq.elements()
		Object ele=null;
		while ((ele=enums.nextElement())!=null)
		{
			
			String word=(String)ele.
			int wordFreq=(int)enums.Value ;
			int termIndex=GetTermIndex(word);
                  if(termIndex == -1)
                      continue;
			_termFreq [termIndex][i]=wordFre/q;
			_docFreq[termIndex] ++;

			if (wordFreq > _maxTermFreq[i]) _maxTermFreq[i]=wordFreq;					
		}*/
	}
}
 
开发者ID:dimensoft,项目名称:improved-journey,代码行数:39,代码来源:TFIDFMeasure.java

示例10: asMap

import java.util.Dictionary; //导入方法依赖的package包/类
private Map<String, Object> asMap(Dictionary<String, ?> dict) {
	Map<String, Object> map = new HashMap<String, Object>(); // NOSONAR
	for (Enumeration<String> e = dict.keys(); e.hasMoreElements();) {
		String key = e.nextElement();
		map.put(key, dict.get(key));
	}
	return map;
}
 
开发者ID:apache,项目名称:aries-jpa,代码行数:9,代码来源:ManagedEMF.java

示例11: getMinSliderValue

import java.util.Dictionary; //导入方法依赖的package包/类
private static Integer getMinSliderValue(JSlider slider) {
    Dictionary dictionary = slider.getLabelTable();
    if (dictionary != null) {
        Enumeration keys = dictionary.keys();
        int min = slider.getMaximum() + 1;
        while (keys.hasMoreElements()) {
            min = Math.min(min, ((Integer)keys.nextElement()).intValue());
        }
        if (min == slider.getMaximum() + 1) {
            return null;
        }
        return new Integer(min);
    }
    return null;
}
 
开发者ID:fesch,项目名称:Moenagade,代码行数:16,代码来源:Baseline.java

示例12: reapplyFontSize

import java.util.Dictionary; //导入方法依赖的package包/类
/**
 * Apply the font size to the labels of a slider. This must be called after
 * the labels of a slider are changed.
 *
 * First set up the label hash table and add it to the slider. Then, after
 * the slider has been added to a parent window and had its UI assigned,
 * call this method to change the label sizes.
 *
 * http://nadeausoftware.com/node/93#Settingsliderlabelfontsizes
 * 
 * @param slider
 */
public static void reapplyFontSize(JSlider slider) {

    Font font = slider.getFont();
    Dictionary dict = slider.getLabelTable();
    Enumeration keys = dict.keys();
    while (keys.hasMoreElements()) {
        Object key = keys.nextElement();
        Component label = (Component) dict.get(key);
        label.setFont(font);
        label.setSize(label.getPreferredSize());
    }

}
 
开发者ID:berniejenny,项目名称:MapAnalyst,代码行数:26,代码来源:SliderUtils.java

示例13: putAll

import java.util.Dictionary; //导入方法依赖的package包/类
public <T extends K> void putAll(Dictionary<T, ? extends V> dictionary) {
	if (dictionary != null)
		// copy the dictionary
		for (Enumeration<T> enm = dictionary.keys(); enm.hasMoreElements();) {
			T key = enm.nextElement();
			map.put(key, dictionary.get(key));
		}
}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:9,代码来源:MapBasedDictionary.java

示例14: getWidthOfWidestLabel

import java.util.Dictionary; //导入方法依赖的package包/类
protected int getWidthOfWidestLabel() {
    Dictionary dictionary = slider.getLabelTable();
    int widest = 0;
    if ( dictionary != null ) {
        Enumeration keys = dictionary.keys();
        while ( keys.hasMoreElements() ) {
            JComponent label = (JComponent) dictionary.get(keys.nextElement());
            widest = Math.max( label.getPreferredSize().width, widest );
        }
    }
    return widest;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:BasicSliderUI.java

示例15: getWidthOfWidestLabel

import java.util.Dictionary; //导入方法依赖的package包/类
/**
 * Returns the width of the widest label.
 * @return the width of the widest label
 */
protected int getWidthOfWidestLabel() {
    @SuppressWarnings("rawtypes")
    Dictionary dictionary = slider.getLabelTable();
    int widest = 0;
    if ( dictionary != null ) {
        Enumeration<?> keys = dictionary.keys();
        while ( keys.hasMoreElements() ) {
            JComponent label = (JComponent) dictionary.get(keys.nextElement());
            widest = Math.max( label.getPreferredSize().width, widest );
        }
    }
    return widest;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:18,代码来源:BasicSliderUI.java


注:本文中的java.util.Dictionary.keys方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。