01: /*
02: (c) Copyright 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP, all rights reserved.
03: [See end of file]
04: $Id: GraphEvents.java,v 1.8 2008/01/02 12:06:55 andy_seaborne Exp $
05: */
06: package com.hp.hpl.jena.graph;
07:
08: /**
09: GraphEvents is the base class for Jena general graph events. Each graph event
10: has a title and some content.
11:
12: @author kers
13: */
14: public class GraphEvents {
15: public static final GraphEvents removeAll = new GraphEvents(
16: "removeAll", "");
17:
18: public static final GraphEvents startRead = new GraphEvents(
19: "startRead", "");
20:
21: public static final GraphEvents finishRead = new GraphEvents(
22: "finishRead", "");
23:
24: private String title;
25: private Object content;
26:
27: public GraphEvents(String title, Object content) {
28: this .title = title;
29: this .content = content;
30: }
31:
32: public boolean equals(Object o) {
33: return o instanceof GraphEvents && same((GraphEvents) o);
34: }
35:
36: public boolean same(GraphEvents o) {
37: return title.equals(o.title) && content.equals(o.content);
38: }
39:
40: public static GraphEvents remove(Node s, Node p, Node o) {
41: return new GraphEvents("remove", Triple.create(s, p, o));
42: }
43:
44: public String toString() {
45: return "<GE " + title + ">";
46: }
47:
48: public Object getContent() {
49: return content;
50: }
51:
52: public Object getTitle() {
53: return title;
54: }
55: }
56:
57: /*
58: (c) Copyright 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
59: All rights reserved.
60:
61: Redistribution and use in source and binary forms, with or without
62: modification, are permitted provided that the following conditions
63: are met:
64:
65: 1. Redistributions of source code must retain the above copyright
66: notice, this list of conditions and the following disclaimer.
67:
68: 2. Redistributions in binary form must reproduce the above copyright
69: notice, this list of conditions and the following disclaimer in the
70: documentation and/or other materials provided with the distribution.
71:
72: 3. The name of the author may not be used to endorse or promote products
73: derived from this software without specific prior written permission.
74:
75: THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
76: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
77: OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
78: IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
79: INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
80: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
81: DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
82: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
83: (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
84: THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
85: */
|