All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ontoware.rdf2go.model.node.impl.ResourceImpl Maven / Gradle / Ivy

Go to download

RDF2go is an implementation-independent Java API with the design goals: portability (hence the name), performance and ease of implementation. This project was started at FZI Forschungszentrum Informatik Karlsruhe, Germany - www.fzi.de

The newest version!
/**
 * LICENSE INFORMATION
 *
 * Copyright 2005-2008 by FZI (http://www.fzi.de).
 * Licensed under a BSD license (http://www.opensource.org/licenses/bsd-license.php)
 *  = Max Völkel
 *  = FZI Forschungszentrum Informatik Karlsruhe, Karlsruhe, Germany
 *  = 2010
 *
 * Further project information at http://semanticweb.org/wiki/RDF2Go
 */

package org.ontoware.rdf2go.model.node.impl;

import java.util.Date;

import org.ontoware.rdf2go.exception.ModelRuntimeException;
import org.ontoware.rdf2go.model.node.DatatypeLiteral;
import org.ontoware.rdf2go.model.node.LanguageTagLiteral;
import org.ontoware.rdf2go.model.node.Literal;
import org.ontoware.rdf2go.model.node.Resource;

public abstract class ResourceImpl implements Resource {

	/**
     * 
     */
    private static final long serialVersionUID = -2823155956202460052L;

	@Override
	public abstract boolean equals( Object other );
	
	@Override
	public abstract int hashCode();

	@Override
    public Resource asResource() throws ClassCastException {
		return this;
	}

	@Override
    public Literal asLiteral() throws ClassCastException {
		throw new ClassCastException("Cannot call this on a resource");
	}

	@Override
    public DatatypeLiteral asDatatypeLiteral() throws ClassCastException {
		throw new ClassCastException("Cannot call this on a resource");
	}

	@Override
    public LanguageTagLiteral asLanguageTagLiteral() throws ClassCastException {
		throw new ClassCastException("Cannot call this on a resource");
	}

	public String asString() throws ModelRuntimeException {
		throw new ModelRuntimeException("Cannot call this on a resource");
	}

	public int asInt() throws ModelRuntimeException {
		throw new ModelRuntimeException("Cannot call this on a resource");
	}

	public boolean asBoolean() throws ModelRuntimeException {
		throw new ModelRuntimeException("Cannot call this on a resource");
	}

	public Date asDate() throws ModelRuntimeException {
		throw new ModelRuntimeException("Cannot call this on a resource");
	}
	

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy