01: /*
02: * LICENSE INFORMATION
03: * Copyright 2005-2007 by FZI (http://www.fzi.de).
04: * Licensed under a BSD license (http://www.opensource.org/licenses/bsd-license.php)
05: * <OWNER> = Max Völkel
06: * <ORGANIZATION> = FZI Forschungszentrum Informatik Karlsruhe, Karlsruhe, Germany
07: * <YEAR> = 2007
08: *
09: * Project information at http://semweb4j.org/rdf2go
10: */
11: package org.ontoware.rdf2go.model.node.impl;
12:
13: import java.util.Date;
14:
15: import org.ontoware.rdf2go.exception.ModelRuntimeException;
16: import org.ontoware.rdf2go.model.node.DatatypeLiteral;
17: import org.ontoware.rdf2go.model.node.LanguageTagLiteral;
18: import org.ontoware.rdf2go.model.node.Literal;
19: import org.ontoware.rdf2go.model.node.Resource;
20:
21: public abstract class ResourceImpl implements Resource {
22:
23: public abstract boolean equals(Object other);
24:
25: public abstract int hashCode();
26:
27: public Resource asResource() throws ClassCastException {
28: return this ;
29: }
30:
31: public Literal asLiteral() throws ClassCastException {
32: throw new ClassCastException("Cannot call this on a resource");
33: }
34:
35: public DatatypeLiteral asDatatypeLiteral()
36: throws ClassCastException {
37: throw new ClassCastException("Cannot call this on a resource");
38: }
39:
40: public LanguageTagLiteral asLanguageTagLiteral()
41: throws ClassCastException {
42: throw new ClassCastException("Cannot call this on a resource");
43: }
44:
45: public String asString() throws ModelRuntimeException {
46: throw new ModelRuntimeException(
47: "Cannot call this on a resource");
48: }
49:
50: public int asInt() throws ModelRuntimeException {
51: throw new ModelRuntimeException(
52: "Cannot call this on a resource");
53: }
54:
55: public boolean asBoolean() throws ModelRuntimeException {
56: throw new ModelRuntimeException(
57: "Cannot call this on a resource");
58: }
59:
60: public Date asDate() throws ModelRuntimeException {
61: throw new ModelRuntimeException(
62: "Cannot call this on a resource");
63: }
64:
65: }
|