Package org.gephi.data.attributes.type

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


    @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());
View Full Code Here


            if (value instanceof String && !column.getType().equals(AttributeType.DYNAMIC_STRING)) {
                //Value needs to be parsed
                value = TypeConvertor.getStaticType(column.getType()).parse((String) value);
            }
            //Wrap value in a dynamic type
            value = DynamicUtilities.createDynamicObject(column.getType(), new Interval(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, value));
        }
        attributeRow.setValue(column, value);
    }
View Full Code Here

            AttributeType staticType = TypeConvertor.getStaticType(column.getType());
            value = staticType.parse((String) value);
        }
        Object sourceVal = attributeRow.getValue(column);
        if (sourceVal != null && sourceVal instanceof DynamicType) {
            value = DynamicUtilities.createDynamicObject(column.getType(), (DynamicType) sourceVal, new Interval(start, end, startOpen, endOpen, value));
        } else if (sourceVal != null && !(sourceVal instanceof DynamicType)) {
            List<Interval> intervals = new ArrayList<Interval>(2);
            intervals.add(new Interval(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, sourceVal));
            intervals.add(new Interval(start, end, startOpen, endOpen, value));
            value = DynamicUtilities.createDynamicObject(column.getType(), intervals);
        } else {
            value = DynamicUtilities.createDynamicObject(column.getType(), new Interval(start, end, startOpen, endOpen, value));
        }
        attributeRow.setValue(column, value);
    }
View Full Code Here

            if (value instanceof String && !column.getType().equals(AttributeType.DYNAMIC_STRING)) {
                //Value needs to be parsed
                value = TypeConvertor.getStaticType(column.getType()).parse((String) value);
            }
            //Wrap value in a dynamic type
            value = DynamicUtilities.createDynamicObject(column.getType(), new Interval(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, value));
        }
        attributeRow.setValue(column, value);
    }
View Full Code Here

            //Value needs to be parsed
            value = TypeConvertor.getStaticType(column.getType()).parse((String) value);
        }
        Object sourceVal = attributeRow.getValue(column);
        if (sourceVal != null && sourceVal instanceof DynamicType) {
            value = DynamicUtilities.createDynamicObject(column.getType(), (DynamicType) sourceVal, new Interval(start, end, startOpen, endOpen, value));
        } else if (sourceVal != null && !(sourceVal instanceof DynamicType)) {
            List<Interval> intervals = new ArrayList<Interval>(2);
            intervals.add(new Interval(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, sourceVal));
            intervals.add(new Interval(start, end, startOpen, endOpen, value));
            value = DynamicUtilities.createDynamicObject(column.getType(), intervals);
        } else {
            value = DynamicUtilities.createDynamicObject(column.getType(), new Interval(start, end, startOpen, endOpen, value));
        }
        attributeRow.setValue(column, value);
    }
View Full Code Here

  }

  @Override
  public Object[] getAttributesValues(Node node, double low, double high) {
    checkLowHigh(low, high);
    return getAttributesValues(node, new Interval(low, high));
  }
View Full Code Here

  }

  @Override
  public Object[] getAttributesValues(Node node, double low, double high, Estimator[] estimators) {
    checkLowHigh(low, high);
    return getAttributesValues(node, new Interval(low, high), estimators);
  }
View Full Code Here

  }

  @Override
  public Object[] getAttributesValues(Edge edge, double low, double high) {
    checkLowHigh(low, high);
    return getAttributesValues(edge, new Interval(low, high));
  }
View Full Code Here

  }

  @Override
  public Object[] getAttributesValues(Edge edge, double low, double high, Estimator[] estimators) {
    checkLowHigh(low, high);
    return getAttributesValues(edge, new Interval(low, high), estimators);
  }
View Full Code Here

  }

  @Override
  public Graph getSnapshotGraph(double low, double high, Estimator estimator) {
    checkLowHigh(low, high);
    return getSnapshotGraph(new Interval(low, high), Estimator.FIRST);
  }
View Full Code Here

TOP

Related Classes of org.gephi.data.attributes.type.Interval

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.