01: /*
02: (c) Copyright 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
03: [See end of file]
04: $Id: Factory.java,v 1.30 2008/01/03 15:41:20 chris-dollin Exp $
05: */
06:
07: package com.hp.hpl.jena.graph;
08:
09: import com.hp.hpl.jena.mem.faster.GraphMemFaster;
10: import com.hp.hpl.jena.shared.*;
11:
12: /**
13: A factory class for creating Graphs.
14:
15: @author kers
16: */
17:
18: public class Factory {
19: private Factory() {
20: super ();
21: }
22:
23: /**
24: @deprecated -- doesn't do anything anymore.
25: */
26: public static final boolean faster = true;
27:
28: /**
29: @deprecated -- doesn't do anything anymore.
30: */
31: public static final boolean newHashing = true;
32:
33: /**
34: Answer a memory-based Graph with the Standard reification style.
35: */
36: public static Graph createDefaultGraph() {
37: return createDefaultGraph(ReificationStyle.Standard);
38: }
39:
40: /**
41: Answer a memory-based Graph with the given reification style.
42: */
43: public static Graph createDefaultGraph(ReificationStyle style) {
44: return Factory.createGraphMem(style);
45: }
46:
47: public static Graph createGraphMem() {
48: return new GraphMemFaster();
49: }
50:
51: public static Graph createGraphMem(ReificationStyle style) {
52: return new GraphMemFaster(style);
53: }
54:
55: public static Graph createGraphMemWithTransactionHandler(
56: final TransactionHandler th) {
57: Graph g = new GraphMemFaster() {
58: public TransactionHandler getTransactionHandler() {
59: return th;
60: }
61: };
62: return g;
63: }
64: }
65:
66: /*
67: (c) Copyright 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
68: All rights reserved.
69:
70: Redistribution and use in source and binary forms, with or without
71: modification, are permitted provided that the following conditions
72: are met:
73:
74: 1. Redistributions of source code must retain the above copyright
75: notice, this list of conditions and the following disclaimer.
76:
77: 2. Redistributions in binary form must reproduce the above copyright
78: notice, this list of conditions and the following disclaimer in the
79: documentation and/or other materials provided with the distribution.
80:
81: 3. The name of the author may not be used to endorse or promote products
82: derived from this software without specific prior written permission.
83:
84: THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
85: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
86: OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
87: IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
88: INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
89: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
90: DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
91: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
92: (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
93: THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
94: */
|