Package com.cedarsoftware.util

Examples of com.cedarsoftware.util.CaseInsensitiveMap


     */
    public void addMetaProperties(Map allAtOnce)
    {
        if (metaProps == null)
        {
            metaProps = new CaseInsensitiveMap();
        }
        metaProps.putAll(allAtOnce);
    }
View Full Code Here


    /**
     * @return Map (case insensitive keys) containing meta (additional) properties for the n-cube.
     */
    public Map<String, Object> getMetaProperties()
    {
        Map ret = metaProps == null ? new CaseInsensitiveMap() : metaProps;
        return Collections.unmodifiableMap(ret);
    }
View Full Code Here

    {
        if (headers == null)
        {
            headers = new String[]{};
        }
        Map headerStrings = new CaseInsensitiveMap();
        for (String header : headers)
        {
            headerStrings.put(header, null);
        }
        // Step 1. Sort axes from smallest to largest.
        // Hypercubes look best when the smaller axes are on the inside, and the larger axes are on the outside.
        List<Axis> axes = new ArrayList<Axis>(ncube.getAxes());
        Collections.sort(axes, new Comparator<Axis>()
        {
            public int compare(Axis a1, Axis a2)
            {
                return a2.size() - a1.size();
            }
        });

        // Step 2.  Now find an axis that is a good candidate for the single (top) axis.  This would be an axis
        // with the number of columns closest to 12.
        int smallestDelta = Integer.MAX_VALUE;
        int candidate = -1;
        int count = 0;

        for (Axis axis : axes)
        {
            if (headerStrings.keySet().contains(axis.getName()))
            {
                candidate = count;
                break;
            }
            int delta = abs(axis.size() - 12);
View Full Code Here

    {
        if (_headers == null)
        {
            _headers = new String[]{};
        }
        Map headerStrings = new CaseInsensitiveMap();
        for (String header : _headers)
        {
            headerStrings.put(header, null);
        }
        // Step 1. Sort axes from smallest to largest.
        // Hypercubes look best when the smaller axes are on the inside, and the larger axes are on the outside.
        List<Axis> axes = new ArrayList<Axis>(ncube.getAxes());
        Collections.sort(axes, new Comparator<Axis>()
        {
            public int compare(Axis a1, Axis a2)
            {
                return a2.size() - a1.size();
            }
        });

        // Step 2.  Now find an axis that is a good candidate for the single (top) axis.  This would be an axis
        // with the number of columns closest to 12.
        int smallestDelta = Integer.MAX_VALUE;
        int candidate = -1;
        int count = 0;

        for (Axis axis : axes)
        {
            if (headerStrings.keySet().contains(axis.getName()))
            {
                candidate = count;
                break;
            }
            int delta = abs(axis.size() - 12);
View Full Code Here

    /**
     * @return Map (case insensitive keys) containing meta (additional) properties for the n-cube.
     */
    public Map<String, Object> getMetaProperties()
    {
        Map ret = metaProps == null ? new CaseInsensitiveMap() : metaProps;
        return Collections.unmodifiableMap(ret);
    }
View Full Code Here

            {
                throw new IllegalArgumentException("JSON format must have a root 'ncube' field containing the String name of the NCube.");
            }
            NCube ncube = new NCube(cubeName);
            ncube.setVersion("file");
            ncube.metaProps = new CaseInsensitiveMap();
            ncube.metaProps.putAll(jsonNCube);
            ncube.metaProps.remove("ncube");
            ncube.metaProps.remove("defaultCellValue");
            ncube.metaProps.remove("defaultCellValueType");
            ncube.metaProps.remove("ruleMode");
View Full Code Here

    /**
     * @return Map (case insensitive keys) containing meta (additional) properties for the n-cube.
     */
    public Map<String, Object> getMetaProperties()
    {
        Map ret = metaProps == null ? new CaseInsensitiveMap() : metaProps;
        return Collections.unmodifiableMap(ret);
    }
View Full Code Here

            {
                throw new IllegalArgumentException("JSON format must have a root 'ncube' field containing the String name of the NCube.");
            }
            NCube ncube = new NCube(cubeName);
            ncube.setVersion("file");
            ncube.metaProps = new CaseInsensitiveMap();
            ncube.metaProps.putAll(jsonNCube);
            ncube.metaProps.remove("ncube");
            ncube.metaProps.remove("defaultCellValue");
            ncube.metaProps.remove("defaultCellValueType");
            ncube.metaProps.remove("ruleMode");
View Full Code Here

    /**
     * @return Map (case insensitive keys) containing meta (additional) properties for the n-cube.
     */
    public Map<String, Object> getMetaProperties()
    {
        Map ret = metaProps == null ? new CaseInsensitiveMap() : metaProps;
        return Collections.unmodifiableMap(ret);
    }
View Full Code Here

            {
                throw new IllegalArgumentException("JSON format must have a root 'ncube' field containing the String name of the NCube.");
            }
            NCube ncube = new NCube(cubeName);
            ncube.setVersion("file");
            ncube.metaProps = new CaseInsensitiveMap();
            ncube.metaProps.putAll(jsonNCube);
            ncube.metaProps.remove("ncube");
            ncube.metaProps.remove("defaultCellValue");
            ncube.metaProps.remove("defaultCellValueType");
            ncube.metaProps.remove("ruleMode");
View Full Code Here

TOP

Related Classes of com.cedarsoftware.util.CaseInsensitiveMap

Copyright © 2018 www.massapicom. 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.