/** * Returns the type name for the given type. * * @param type type to get its name * @return type name */ public static String getTypeName(Class type) { if (!isSupported(type)) { throw new IllegalArgumentException("Unsupported type " + type.getCanonicalName()); } type = getStandardizedType(type); return type.getSimpleName().toLowerCase(); }
/** * Returns the type name for the given type. * * @param type type to get its name * @return type name */ public static String getTypeName(Class type) { if (!isSupported(type)) { throw new IllegalArgumentException("Unsupported type " + type.getCanonicalName()); } type = getStandardizedType(type); return type.getSimpleName().toLowerCase(); }
/** * Returns true if <em>type</em> is a boolean type * <p> * This can be true for static, arrays and dynamic types. * * @param type type to test * @return true if <em>type</em> is a boolean type, false otherwise */ public static boolean isBooleanType(Class type) { if (!isSupported(type)) { throw new IllegalArgumentException("Unsupported type " + type.getCanonicalName()); } type = getStandardizedType(type); return type.equals(Boolean.class) || type.equals(boolean[].class) || type.equals(TimestampBooleanMap.class) || type .equals(IntervalBooleanMap.class); }
/** * Returns true if <em>type</em> is a boolean type * <p> * This can be true for static, arrays and dynamic types. * * @param type type to test * @return true if <em>type</em> is a boolean type, false otherwise */ public static boolean isBooleanType(Class type) { if (!isSupported(type)) { throw new IllegalArgumentException("Unsupported type " + type.getCanonicalName()); } type = getStandardizedType(type); return type.equals(Boolean.class) || type.equals(boolean[].class) || type.equals(TimestampBooleanMap.class) || type .equals(IntervalBooleanMap.class); }
public ColumnImpl(TableImpl table, String id, Class typeClass, String title, Object defaultValue, Origin origin, boolean indexed, boolean readOnly) { if (id == null || id.isEmpty()) { throw new IllegalArgumentException("The column ID can't be null or empty"); } if (typeClass == null) { throw new NullPointerException("The type class can't be null"); } if (origin == null) { throw new NullPointerException("The origin can't be null"); } typeClass = AttributeUtils.getStandardizedType(typeClass); this.table = table; this.id = id.toLowerCase();// Make sure column has lowercase id from // wherever it's created this.typeClass = typeClass; this.title = title; this.defaultValue = defaultValue; this.version = new ColumnVersion(this); this.origin = origin; this.indexed = indexed; this.readOnly = readOnly; this.dynamic = TimeMap.class.isAssignableFrom(typeClass) || TimeSet.class.isAssignableFrom(typeClass); this.observers = GraphStoreConfiguration.ENABLE_OBSERVERS ? new ArrayList<ColumnObserverImpl>() : null; this.estimator = this.dynamic ? Estimator.FIRST : null; }
/** * Returns true if <em>type</em> is a number type. * <p> * This can be true for static, arrays and dynamic types. * * @param type type to test * @return true if <em>type</em> is a number type, false otherwise */ public static boolean isNumberType(Class type) { if (!isSupported(type)) { throw new IllegalArgumentException("Unsupported type " + type.getCanonicalName()); } type = getStandardizedType(type); return Number.class.isAssignableFrom(type) || int[].class.isAssignableFrom(type) || float[].class .isAssignableFrom(type) || double[].class.isAssignableFrom(type) || byte[].class.isAssignableFrom(type) || short[].class .isAssignableFrom(type) || long[].class.isAssignableFrom(type) || type .equals(TimestampIntegerMap.class) || type.equals(TimestampFloatMap.class) || type .equals(TimestampDoubleMap.class) || type.equals(TimestampLongMap.class) || type .equals(TimestampShortMap.class) || type.equals(TimestampByteMap.class) || type .equals(IntervalIntegerMap.class) || type.equals(IntervalFloatMap.class) || type .equals(IntervalDoubleMap.class) || type.equals(IntervalLongMap.class) || type .equals(IntervalShortMap.class) || type.equals(IntervalByteMap.class); }
/** * Returns true if <em>type</em> is a number type. * <p> * This can be true for static, arrays and dynamic types. * * @param type type to test * @return true if <em>type</em> is a number type, false otherwise */ public static boolean isNumberType(Class type) { if (!isSupported(type)) { throw new IllegalArgumentException("Unsupported type " + type.getCanonicalName()); } type = getStandardizedType(type); return Number.class.isAssignableFrom(type) || int[].class.isAssignableFrom(type) || float[].class .isAssignableFrom(type) || double[].class.isAssignableFrom(type) || byte[].class.isAssignableFrom(type) || short[].class .isAssignableFrom(type) || long[].class.isAssignableFrom(type) || type .equals(TimestampIntegerMap.class) || type.equals(TimestampFloatMap.class) || type .equals(TimestampDoubleMap.class) || type.equals(TimestampLongMap.class) || type .equals(TimestampShortMap.class) || type.equals(TimestampByteMap.class) || type .equals(IntervalIntegerMap.class) || type.equals(IntervalFloatMap.class) || type .equals(IntervalDoubleMap.class) || type.equals(IntervalLongMap.class) || type .equals(IntervalShortMap.class) || type.equals(IntervalByteMap.class); }
public ColumnImpl(TableImpl table, String id, Class typeClass, String title, Object defaultValue, Origin origin, boolean indexed, boolean readOnly) { if (id == null || id.isEmpty()) { throw new IllegalArgumentException("The column ID can't be null or empty"); } if (typeClass == null) { throw new NullPointerException("The type class can't be null"); } if (origin == null) { throw new NullPointerException("The origin can't be null"); } typeClass = AttributeUtils.getStandardizedType(typeClass); this.table = table; this.id = id.toLowerCase();// Make sure column has lowercase id from // wherever it's created this.typeClass = typeClass; this.title = title; this.defaultValue = defaultValue; this.version = new ColumnVersion(this); this.origin = origin; this.indexed = indexed; this.readOnly = readOnly; this.dynamic = TimeMap.class.isAssignableFrom(typeClass) || TimeSet.class.isAssignableFrom(typeClass); this.observers = GraphStoreConfiguration.ENABLE_OBSERVERS ? new ArrayList<ColumnObserverImpl>() : null; this.estimator = this.dynamic ? Estimator.FIRST : null; }
public void resetConfiguration() { this.nodeAssignConfiguration = getAssignConfiguration(AttributeUtils.getStandardizedType(store.configuration .getNodeIdType())); this.edgeAssignConfiguration = getAssignConfiguration(AttributeUtils.getStandardizedType(store.configuration .getEdgeIdType())); }
public GraphFactoryImpl(GraphStore store) { this.store = store; this.nodeAssignConfiguration = getAssignConfiguration(AttributeUtils.getStandardizedType(store.configuration .getNodeIdType())); this.edgeAssignConfiguration = getAssignConfiguration(AttributeUtils.getStandardizedType(store.configuration .getEdgeIdType())); }
public GraphFactoryImpl(GraphStore store) { this.store = store; this.nodeAssignConfiguration = getAssignConfiguration(AttributeUtils.getStandardizedType(store.configuration .getNodeIdType())); this.edgeAssignConfiguration = getAssignConfiguration(AttributeUtils.getStandardizedType(store.configuration .getEdgeIdType())); }
public void resetConfiguration() { this.nodeAssignConfiguration = getAssignConfiguration(AttributeUtils.getStandardizedType(store.configuration .getNodeIdType())); this.edgeAssignConfiguration = getAssignConfiguration(AttributeUtils.getStandardizedType(store.configuration .getEdgeIdType())); }
throw new IllegalArgumentException("Unsupported type " + type.getCanonicalName()); type = getStandardizedType(type); if (type.equals(Boolean.class)) { return TimestampBooleanMap.class;
throw new IllegalArgumentException("Unsupported type " + type.getCanonicalName()); type = getStandardizedType(type); if (type.equals(Boolean.class)) { return IntervalBooleanMap.class;
throw new IllegalArgumentException("Unsupported type " + type.getCanonicalName()); type = getStandardizedType(type); if (type.equals(Boolean.class)) { return TimestampBooleanMap.class;
throw new IllegalArgumentException("Unsupported type " + type.getCanonicalName()); type = getStandardizedType(type); if (type.equals(Boolean.class)) { return IntervalBooleanMap.class;
@Override public Column addColumn(String id, String title, Class type, Origin origin, Object defaultValue, boolean indexed) { checkValidId(id); checkSupportedTypes(type); checkDefaultValue(defaultValue, type); type = AttributeUtils.getStandardizedType(type); if (defaultValue != null) { defaultValue = AttributeUtils.standardizeValue(defaultValue); } if (title == null || title.isEmpty()) { title = id; } id = id.toLowerCase(); if (indexed && store.indexStore == null) { indexed = false; } ColumnImpl column = new ColumnImpl(this, id, type, title, defaultValue, origin, indexed, false); store.addColumn(column); return column; }
@Override public Column addColumn(String id, String title, Class type, Origin origin, Object defaultValue, boolean indexed) { checkValidId(id); checkSupportedTypes(type); checkDefaultValue(defaultValue, type); type = AttributeUtils.getStandardizedType(type); if (defaultValue != null) { defaultValue = AttributeUtils.standardizeValue(defaultValue); } if (title == null || title.isEmpty()) { title = id; } id = id.toLowerCase(); if (indexed && store.indexStore == null) { indexed = false; } ColumnImpl column = new ColumnImpl(this, id, type, title, defaultValue, origin, indexed, false); store.addColumn(column); return column; }
typeClass = AttributeUtils.getStandardizedType(typeClass); if (typeClass.equals(String.class)) { result = new IntervalStringMap(capacity);
typeClass = AttributeUtils.getStandardizedType(typeClass); if (typeClass.equals(String.class)) { result = new IntervalStringMap(capacity);