From 0f854ec2b70b2b00ff0a62cb9f157d647910e52b Mon Sep 17 00:00:00 2001 From: Michael Lieberman Date: Mon, 29 Dec 2014 12:33:04 -0500 Subject: [PATCH] Separate out Features creation --- .../jhuapl/tinkerpop/AccumuloFeatures.java | 59 +++++++++++++++++++ .../edu/jhuapl/tinkerpop/AccumuloGraph.java | 39 +----------- 2 files changed, 60 insertions(+), 38 deletions(-) create mode 100644 src/main/java/edu/jhuapl/tinkerpop/AccumuloFeatures.java diff --git a/src/main/java/edu/jhuapl/tinkerpop/AccumuloFeatures.java b/src/main/java/edu/jhuapl/tinkerpop/AccumuloFeatures.java new file mode 100644 index 0000000..6a8a7f1 --- /dev/null +++ b/src/main/java/edu/jhuapl/tinkerpop/AccumuloFeatures.java @@ -0,0 +1,59 @@ +/****************************************************************************** + * COPYRIGHT NOTICE * + * Copyright (c) 2014 The Johns Hopkins University/Applied Physics Laboratory * + * All rights reserved. * + * * + * This material may only be used, modified, or reproduced by or for the * + * U.S. Government pursuant to the license rights granted under FAR clause * + * 52.227-14 or DFARS clauses 252.227-7013/7014. * + * * + * For any other permissions, please contact the Legal Office at JHU/APL. * + ******************************************************************************/ +package edu.jhuapl.tinkerpop; + +import com.tinkerpop.blueprints.Features; + +/** + * {@link Features} creator. + */ +public class AccumuloFeatures { + + public static Features get() { + Features f = new Features(); + + // For simplicity, I accept all property types. They are handled in not the + // best way. To be fixed later. + f.ignoresSuppliedIds = true; + f.isPersistent = true; + f.isWrapper = false; + f.supportsBooleanProperty = true; + f.supportsDoubleProperty = true; + f.supportsDuplicateEdges = true; + f.supportsEdgeIndex = true; + f.supportsEdgeIteration = true; + f.supportsEdgeRetrieval = true; + f.supportsEdgeKeyIndex = true; + f.supportsEdgeProperties = true; + f.supportsFloatProperty = true; + f.supportsIndices = true; + f.supportsIntegerProperty = true; + f.supportsKeyIndices = true; + f.supportsLongProperty = true; + f.supportsMapProperty = true; + f.supportsMixedListProperty = true; + f.supportsPrimitiveArrayProperty = true; + f.supportsSelfLoops = true; + f.supportsSerializableObjectProperty = true; + f.supportsStringProperty = true; + f.supportsThreadedTransactions = false; + f.supportsTransactions = false; + f.supportsUniformListProperty = true; + f.supportsVertexIndex = true; + f.supportsVertexIteration = true; + f.supportsVertexKeyIndex = true; + f.supportsVertexProperties = true; + f.supportsThreadIsolatedTransactions = false; + + return f; + } +} diff --git a/src/main/java/edu/jhuapl/tinkerpop/AccumuloGraph.java b/src/main/java/edu/jhuapl/tinkerpop/AccumuloGraph.java index 5449ef3..fb97c6b 100644 --- a/src/main/java/edu/jhuapl/tinkerpop/AccumuloGraph.java +++ b/src/main/java/edu/jhuapl/tinkerpop/AccumuloGraph.java @@ -283,46 +283,9 @@ public class AccumuloGraph implements Graph, KeyIndexableGraph, IndexableGraph { // End Aliases - // For simplicity, I accept all property types. They are handled in not the - // best way. To be fixed later - Features f; - @Override public Features getFeatures() { - if (f == null) { - f = new Features(); - f.ignoresSuppliedIds = true; - f.isPersistent = true; - f.isWrapper = false; - f.supportsBooleanProperty = true; - f.supportsDoubleProperty = true; - f.supportsDuplicateEdges = true; - f.supportsEdgeIndex = true; - f.supportsEdgeIteration = true; - f.supportsEdgeRetrieval = true; - f.supportsEdgeKeyIndex = true; - f.supportsEdgeProperties = true; - f.supportsFloatProperty = true; - f.supportsIndices = true; - f.supportsIntegerProperty = true; - f.supportsKeyIndices = true; - f.supportsLongProperty = true; - f.supportsMapProperty = true; - f.supportsMixedListProperty = true; - f.supportsPrimitiveArrayProperty = true; - f.supportsSelfLoops = true; - f.supportsSerializableObjectProperty = true; - f.supportsStringProperty = true; - f.supportsThreadedTransactions = false; - f.supportsTransactions = false; - f.supportsUniformListProperty = true; - f.supportsVertexIndex = true; - f.supportsVertexIteration = true; - f.supportsVertexKeyIndex = true; - f.supportsVertexProperties = true; - f.supportsThreadIsolatedTransactions = false; - } - return f; + return AccumuloFeatures.get(); } @Override