Examples of DynamicType


Examples of org.eclipse.persistence.dynamic.DynamicType

     *
     * @return Dynamic type of this entity
     * @throws DynamicException if type is null
     */
    public DynamicTypeImpl getType() throws DynamicException {
        DynamicType type = fetchPropertiesManager().getType();
        if (type == null) {
            throw DynamicException.entityHasNullType(this);
        }
        return (DynamicTypeImpl) type;
    }
View Full Code Here

Examples of org.eclipse.persistence.dynamic.DynamicType

     *
     * @return Dynamic type of this entity
     * @throws DynamicException if type is null
     */
    public DynamicTypeImpl getType() throws DynamicException {
        DynamicType type = fetchPropertiesManager().getType();
        if (type == null) {
            throw DynamicException.entityHasNullType(this);
        }
        return (DynamicTypeImpl)type;
    }
View Full Code Here

Examples of org.eclipse.persistence.dynamic.DynamicType

        try{
            entity = helper.newDynamicEntity(type);
        } catch (IllegalArgumentException e){
            ClassDescriptor descriptor = getDescriptor(type);
            if (descriptor != null){
                DynamicType jaxbType = (DynamicType) descriptor.getProperty(DynamicType.DESCRIPTOR_PROPERTY);
                if (jaxbType != null){
                    return jaxbType.newDynamicEntity();
                }
            }
            JPARSLogger.fine("exception_thrown_while_creating_dynamic_entity", new Object[]{type, e.toString()});
            throw e;
        }
View Full Code Here

Examples of org.eclipse.persistence.dynamic.DynamicType

     *
     * @return Dynamic type of this entity
     * @throws DynamicException if type is null
     */
    public DynamicTypeImpl getType() throws DynamicException {
        DynamicType type = fetchPropertiesManager().getType();
        if (type == null) {
            throw DynamicException.entityHasNullType(this);
        }
        return (DynamicTypeImpl)type;
    }
View Full Code Here

Examples of org.gephi.data.attributes.type.DynamicType

            for (NodeDraftImpl node : nodeMap.values()) {
                AttributeValue[] values = node.getAttributeRow().getValues();
                for (int i = 0; i < values.length; i++) {
                    AttributeValue val = values[i];
                    if (val.getValue() != null && val.getValue() instanceof DynamicType) {   //is Dynamic type
                        DynamicType type = (DynamicType) val.getValue();
                        type = DynamicUtilities.removeOverlapping(type);
                        node.getAttributeRow().setValue(val.getColumn(), type);
                    }
                }
            }
            for (EdgeDraftImpl edge : edgeMap.values()) {
                AttributeValue[] values = edge.getAttributeRow().getValues();
                for (int i = 0; i < values.length; i++) {
                    AttributeValue val = values[i];
                    if (val.getValue() != null && val.getValue() instanceof DynamicType) {   //is Dynamic type
                        DynamicType type = (DynamicType) val.getValue();
                        type = DynamicUtilities.removeOverlapping(type);
                        edge.getAttributeRow().setValue(val.getColumn(), type);
                    }
                }
            }
        }

        //Dynamic attributes bounds
        if (dynamicGraph && (timeIntervalMin != null || timeIntervalMax != null)) {
            for (NodeDraftImpl node : nodeMap.values()) {
                boolean issue = false;
                if (timeIntervalMin != null || timeIntervalMax != null) {
                    if (timeIntervalMin != null && node.getTimeInterval() != null && node.getTimeInterval().getLow() < timeIntervalMin) {
                        node.setTimeInterval((TimeInterval) DynamicUtilities.fitToInterval(node.getTimeInterval(), timeIntervalMin, node.getTimeInterval().getHigh()));
                        issue = true;
                    }
                    if (timeIntervalMax != null && node.getTimeInterval() != null && node.getTimeInterval().getHigh() > timeIntervalMax) {
                        node.setTimeInterval((TimeInterval) DynamicUtilities.fitToInterval(node.getTimeInterval(), node.getTimeInterval().getLow(), timeIntervalMax));
                        issue = true;
                    }
                    if (node.getTimeInterval() == null) {
                        node.setTimeInterval(new TimeInterval(timeIntervalMin, timeIntervalMax));
                    }
                }

                AttributeValue[] values = node.getAttributeRow().getValues();
                for (int i = 0; i < values.length; i++) {
                    AttributeValue val = values[i];
                    if (val.getValue() != null && val.getValue() instanceof DynamicType) {   //is Dynamic type
                        DynamicType type = (DynamicType) val.getValue();
                        if (timeIntervalMin != null && type.getLow() < timeIntervalMin) {
                            if (!Double.isInfinite(type.getLow())) {
                                issue = true;
                            }
                            node.getAttributeRow().setValue(val.getColumn(), DynamicUtilities.fitToInterval(type, timeIntervalMin, type.getHigh()));
                        }
                        if (timeIntervalMax != null && type.getHigh() > timeIntervalMax) {
                            if (!Double.isInfinite(type.getHigh())) {
                                issue = true;
                            }
                            node.getAttributeRow().setValue(val.getColumn(), DynamicUtilities.fitToInterval(type, type.getLow(), timeIntervalMax));
                        }
                    }
                }
                if (issue) {
                    report.logIssue(new Issue(NbBundle.getMessage(ImportContainerImpl.class, "ImportContainerException_TimeIntervalVerify_Node_OutOfBound", node.getId()), Level.WARNING));
                }
            }
            for (EdgeDraftImpl edge : edgeMap.values()) {
                boolean issue = false;
                if (timeIntervalMin != null || timeIntervalMax != null) {
                    if (timeIntervalMin != null && edge.getTimeInterval() != null && edge.getTimeInterval().getLow() < timeIntervalMin) {
                        edge.setTimeInterval((TimeInterval) DynamicUtilities.fitToInterval(edge.getTimeInterval(), timeIntervalMin, edge.getTimeInterval().getHigh()));
                        issue = true;
                    }
                    if (timeIntervalMax != null && edge.getTimeInterval() != null && edge.getTimeInterval().getHigh() > timeIntervalMax) {
                        edge.setTimeInterval((TimeInterval) DynamicUtilities.fitToInterval(edge.getTimeInterval(), edge.getTimeInterval().getLow(), timeIntervalMax));
                        issue = true;
                    }
                    if (edge.getTimeInterval() == null) {
                        edge.setTimeInterval(new TimeInterval(timeIntervalMin, timeIntervalMax));
                    }
                }

                AttributeValue[] values = edge.getAttributeRow().getValues();
                for (int i = 0; i < values.length; i++) {
                    AttributeValue val = values[i];
                    if (val.getValue() != null && val.getValue() instanceof DynamicType) {   //is Dynamic type
                        DynamicType type = (DynamicType) val.getValue();
                        if (timeIntervalMin != null && type.getLow() < timeIntervalMin) {
                            if (!Double.isInfinite(type.getLow())) {
                                issue = true;
                            }
                            edge.getAttributeRow().setValue(val.getColumn(), DynamicUtilities.fitToInterval(type, timeIntervalMin, type.getHigh()));
                        }
                        if (timeIntervalMax != null && type.getHigh() > timeIntervalMax) {
                            if (!Double.isInfinite(type.getHigh())) {
                                issue = true;
                            }
                            edge.getAttributeRow().setValue(val.getColumn(), DynamicUtilities.fitToInterval(type, type.getLow(), timeIntervalMax));
                        }
                    }
                }
                if (issue) {
                    report.logIssue(new Issue(NbBundle.getMessage(ImportContainerImpl.class, "ImportContainerException_TimeIntervalVerify_Edge_OutOfBound", edge.getId()), Level.WARNING));
View Full Code Here

Examples of org.gephi.data.attributes.type.DynamicType

    @Test
    public void testCreateDynamicObjectMethods() {
        System.out.println("createDynamicObject(AttributeType, Interval)");
        AttributeType type = AttributeType.DYNAMIC_DOUBLE;
        Interval<Double> in = new Interval(1.0, 2.0, 3.0);
        DynamicType result = DynamicUtilities.createDynamicObject(type, in);
        DynamicType expResult = new DynamicDouble(new Interval<Double>(1.0, 2.0, 3.0));
        assertEquals(expResult, result);
        System.out.println("result:    " + result.toString());
        System.out.println("expResult: " + expResult.toString());
        System.out.println();
    }
View Full Code Here

Examples of org.gephi.data.attributes.type.DynamicType

    }

    @Test
    public void testFitToInterval() {
        System.out.println("fitToInterval(DynamicType, double, double)");
        DynamicType expResult = new DynamicDouble(new Interval<Double>(1.0, 2.0, 0.0));
        DynamicType result = DynamicUtilities.fitToInterval(
                new DynamicDouble(new Interval<Double>(1.0, 3.0, 0.0)),
                1.0, 2.0);
        assertEquals(expResult, result);
        System.out.println("result:    " + result.toString());
        System.out.println("expResult: " + expResult.toString());
        System.out.println();
    }
View Full Code Here

Examples of org.gephi.data.attributes.type.DynamicType

            assertEquals("2", values2[col2.getIndex()].getColumn().getId());
            assertEquals("Author", ((DynamicType) values2[col0.getIndex()].getValue()).getValue());
            assertEquals(new StringList("String1, String2, String 3"), values2[col2.getIndex()].getValue());

            AttributeValue[] values3 = n3.getAttributeRow().getValues();
            DynamicType val4 = (DynamicType) values3[col4.getIndex()].getValue();
            double low = DynamicUtilities.getDoubleFromXMLDateString("2009-01-01");
            double high = DynamicUtilities.getDoubleFromXMLDateString("2009-12-31");
            assertEquals(new Float(3f), val4.getValue(low, high));

            assertEquals("2000-01-01", DynamicUtilities.getXMLDateStringFromDouble(n3.getTimeInterval().getValues().get(0)[0]));
            assertEquals("2000-01-15", DynamicUtilities.getXMLDateStringFromDouble(n3.getTimeInterval().getValues().get(0)[1]));
            assertEquals("2001-01-30", DynamicUtilities.getXMLDateStringFromDouble(n3.getTimeInterval().getValues().get(1)[0]));
            assertEquals("2001-02-01", DynamicUtilities.getXMLDateStringFromDouble(n3.getTimeInterval().getValues().get(1)[1]));
View Full Code Here

Examples of org.gephi.data.attributes.type.DynamicType

        return null;
    }

    public static Object getDynamicValue(Object value, double low, double high) {
        if (value != null && value instanceof DynamicType) {
            DynamicType dynamicType = (DynamicType) value;
            Estimator estimator = Estimator.FIRST;
            if (Number.class.isAssignableFrom(dynamicType.getUnderlyingType())) {
                estimator = Estimator.AVERAGE;
            }
            return dynamicType.getValue(low, high, estimator);
        }
        return value;
    }
View Full Code Here

Examples of org.gephi.data.attributes.type.DynamicType

        return false;
    }

    public Object getDynamicValue(Object attributeValue) {
        if (attributeValue != null && attributeValue instanceof DynamicType) {
            DynamicType dynamicValue = (DynamicType) attributeValue;
            Estimator estimator = dynamicModel == null ? Estimator.FIRST : dynamicModel.getEstimator();
            if (Number.class.isAssignableFrom(dynamicValue.getUnderlyingType())) {
                estimator = dynamicModel == null ? Estimator.AVERAGE : dynamicModel.getNumberEstimator();
            }
            TimeInterval timeInterval = new TimeInterval(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);
            if (dynamic) {
                timeInterval = dynamicModel.getVisibleInterval();
            }
            return dynamicValue.getValue(timeInterval.getLow(), timeInterval.getHigh(), estimator);
        }
        return attributeValue;
    }
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.