1 /* 2 (c) Copyright 2003, 2004, 2005 Hewlett-Packard Development Company, LP 3 [See end of file] 4 $Id: Selector.java,v 1.6 2005/02/21 12:14:26 andy_seaborne Exp $ 5 */ 6 package com.hp.hpl.jena.rdf.model; 7 8 /** A Statement selector. 9 * 10 * <p>Model includes list and query methods which will return all the 11 * statements which are selected by a selector object. This is the interface 12 * of such selector objects. 13 * 14 * @author bwm, kers 15 * @version Release='$Name: $' Revision='$Revision: 1.6 $' Date='$Date: 2005/02/21 12:14:26 $' 16 */ 17 18 public interface Selector { 19 /** Determine whether a Statement should be selected. 20 * @param s The statement to be considered. 21 * @return true if the statement has been selected. 22 */ 23 boolean test( Statement s ); 24 25 /** 26 Answer true iff this Selector is completely characterised by its subject, 27 predicate, and object fields. If so, the <code>test</code> predicate need 28 not be called to decide if a statement is acceptable. This allows query engines 29 lattitude for optimisation (and our memory-based and RDB-based model 30 implementations both exploit this licence). 31 */ 32 boolean isSimple(); 33 34 /** 35 Answer the only subject Resource that this Selector will match, or null if it 36 can match more that a single resource. 37 */ 38 Resource getSubject(); 39 40 /** 41 Answer the only predicate Property that this Selector will match, or null 42 if it can match more than a single property. 43 */ 44 Property getPredicate(); 45 46 /** 47 Answer the only RDFNode object that this Selector will match, or null if 48 it can match more than a single node. 49 */ 50 RDFNode getObject(); 51 52 } 53 /* 54 * (c) Copyright 2000, 2001, 2002, 2003, 2004, 2005 Hewlett-Packard Development Company, LP 55 * All rights reserved. 56 * 57 * Redistribution and use in source and binary forms, with or without 58 * modification, are permitted provided that the following conditions 59 * are met: 60 * 1. Redistributions of source code must retain the above copyright 61 * notice, this list of conditions and the following disclaimer. 62 * 2. Redistributions in binary form must reproduce the above copyright 63 * notice, this list of conditions and the following disclaimer in the 64 * documentation and/or other materials provided with the distribution. 65 * 3. The name of the author may not be used to endorse or promote products 66 * derived from this software without specific prior written permission. 67 68 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 69 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 70 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 71 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 72 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 73 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 74 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 75 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 76 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 77 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 78 * 79 * Selector.java 80 * 81 * Created on 28 July 2000, 13:33 82 */ 83