Package java.util

Examples of java.util.Dictionary.keys()


    protected int getHeightOfTallestLabel() {
        Dictionary table = slider.getLabelTable();
        if (table == null) {
            return 0;
        }
        Enumeration keys = table.keys();
        int result = ((Component)table.get(keys.nextElement())).getHeight();
        while (keys.hasMoreElements()) {
            Component label = ((Component)table.get(keys.nextElement()));
            if (label.getHeight() > result) {
                result = label.getHeight();
View Full Code Here


    protected Component getLowestValueLabel() {
        Dictionary table = slider.getLabelTable();
        if (table == null) {
            return null;
        }
        Enumeration keys = table.keys();
        Integer lastKey = (Integer)keys.nextElement();
        Component result = (Component)table.get(lastKey);
        while (keys.hasMoreElements()) {
            Integer el = (Integer)keys.nextElement();
            if (el.intValue() < lastKey.intValue()) {
View Full Code Here

    protected Component getHighestValueLabel() {
        Dictionary table = slider.getLabelTable();
        if (table == null) {
            return null;
        }
        Enumeration keys = table.keys();
        Integer lastKey = (Integer)keys.nextElement();
        Component result = (Component)table.get(lastKey);
        while (keys.hasMoreElements()) {
            Integer el = (Integer)keys.nextElement();
            if (el.intValue() > lastKey.intValue()) {
View Full Code Here

                System.out.println("BundleLocation: " + config.getBundleLocation());
                if (config.getProperties() != null) {
                    System.out.println("Properties:");
                    Dictionary props = config.getProperties();
                    Map<String, Object> sortedProps = new TreeMap<String, Object>();
                    for (Enumeration e = props.keys(); e.hasMoreElements();) {
                        Object key = e.nextElement();
                        sortedProps.put(key.toString(), props.get(key));
                    }
                    for (String key : sortedProps.keySet()) {
                        System.out.println("   " + key + " = " + sortedProps.get(key));
View Full Code Here

        ReifiedType keyType = type.getActualTypeArgument(0);
        ReifiedType valueType = type.getActualTypeArgument(1);
        Dictionary newDic = new Hashtable();
        if (obj instanceof Dictionary) {
            Dictionary dic = (Dictionary) obj;
            for (Enumeration keyEnum = dic.keys(); keyEnum.hasMoreElements(); ) {
                Object key = keyEnum.nextElement();
                try {
                    newDic.put(convert(key, keyType), convert(dic.get(key), valueType));
                } catch (Exception t) {
                    throw new Exception("Unable to convert from " + obj + " to " + type + "(error converting map entry)", t);
View Full Code Here

        ReifiedType keyType = type.getActualTypeArgument(0);
        ReifiedType valueType = type.getActualTypeArgument(1);
        Map newMap = (Map) getMap(toClass(type)).newInstance();
        if (obj instanceof Dictionary) {
            Dictionary dic = (Dictionary) obj;
            for (Enumeration keyEnum = dic.keys(); keyEnum.hasMoreElements(); ) {
                Object key = keyEnum.nextElement();
                try {
                    newMap.put(convert(key, keyType), convert(dic.get(key), valueType));
                } catch (Exception t) {
                    throw new Exception("Unable to convert from " + obj + " to " + type + "(error converting map entry)", t);
View Full Code Here

                reg.setProperties(EasyMock.isA(Dictionary.class));
                EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() {
                    @Override
                    public Object answer() throws Throwable {
                        // Push the update into the service reference
                        ArrayList<String> oldKeys = Collections.list(props.keys());
                        for (String key : oldKeys) {
                            props.remove(key);
                        }
                        Dictionary<String, Object> newProps = (Dictionary<String, Object>) EasyMock.getCurrentArguments()[0];
                        for (String key : Collections.list(newProps.keys())) {
View Full Code Here

                reg.setProperties(EasyMock.isA(Dictionary.class));
                EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() {
                    @Override
                    public Object answer() throws Throwable {
                        // Push the update into the service reference
                        ArrayList<String> oldKeys = Collections.list(props.keys());
                        for (String key : oldKeys) {
                            props.remove(key);
                        }
                        Dictionary<String, Object> newProps = (Dictionary<String, Object>) EasyMock.getCurrentArguments()[0];
                        for (String key : Collections.list(newProps.keys())) {
View Full Code Here

    public Map<String, String> listProperties(String pid) throws MBeanException {
        try {
            Dictionary dictionary = getConfigProperties(pid);

            Map<String, String> propertiesMap = new HashMap<String, String>();
            for (Enumeration e = dictionary.keys(); e.hasMoreElements(); ) {
                Object key = e.nextElement();
                Object value = dictionary.get(key);
                propertiesMap.put(key.toString(), value.toString());
            }
            return propertiesMap;
View Full Code Here

        ReifiedType keyType = type.getActualTypeArgument(0);
        ReifiedType valueType = type.getActualTypeArgument(1);
        Dictionary newDic = new Hashtable();
        if (obj instanceof Dictionary) {
            Dictionary dic = (Dictionary) obj;
            for (Enumeration keyEnum = dic.keys(); keyEnum.hasMoreElements();) {
                Object key = keyEnum.nextElement();
                try {
                    newDic.put(convert(key, keyType), convert(dic.get(key), valueType));
                } catch (Exception t) {
                    throw new Exception("Unable to convert from " + obj + " to " + type + "(error converting map entry)", t);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.