001: /*
002: * $Header: /export/home/cvsroot/MyPersonalizerRepository/MyPersonalizer/Subsystems/Kernel/Sources/es/udc/mypersonalizer/kernel/model/query/ast/Query.java,v 1.1.1.1 2004/03/25 12:08:37 fbellas Exp $
003: * $Revision: 1.1.1.1 $
004: * $Date: 2004/03/25 12:08:37 $
005: *
006: * =============================================================================
007: *
008: * Copyright (c) 2003, The MyPersonalizer Development Group
009: * (http://www.tic.udc.es/~fbellas/mypersonalizer/index.html) at
010: * University Of A Coruņa
011: * All rights reserved.
012: *
013: * Redistribution and use in source and binary forms, with or without
014: * modification, are permitted provided that the following conditions are met:
015: *
016: * - Redistributions of source code must retain the above copyright notice,
017: * this list of conditions and the following disclaimer.
018: *
019: * - Redistributions in binary form must reproduce the above copyright notice,
020: * this list of conditions and the following disclaimer in the documentation
021: * and/or other materials provided with the distribution.
022: *
023: * - Neither the name of the University Of A Coruņa nor the names of its
024: * contributors may be used to endorse or promote products derived from
025: * this software without specific prior written permission.
026: *
027: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
028: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
029: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
030: * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
031: * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
032: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
033: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
034: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
035: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
036: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
037: * POSSIBILITY OF SUCH DAMAGE.
038: *
039: */
040: package es.udc.mypersonalizer.kernel.model.query.ast;
041:
042: import java.util.List;
043:
044: /**
045: * This class represents a query performed on uppong the metainformation of
046: * <em>MyPersonalizer</em>.
047: * <p>
048: * A query is defined by providing an specification of the result of the query
049: * and a specification of the result ordering.
050: * <p>
051: * These specifications are expressed as <code>Step</code>s, each of which
052: * represent a MetaInformation object. The first step defines the root of
053: * the query, and <b>must</b> be a reference to a <code>MetaService</code>.
054: * Following steps reference <code>MetaProperty</code> objects, either
055: * <em>real</em> (defined with the <code>MetaService</code>) or <em>virtual</em>
056: * (specified externally as <em>bridges</em> between different
057: * <code>MetaService</code>s' properties).
058: * <p>
059: * The return specification and the ordering specification must have, at least,
060: * the root step in common, and must have the same cardinality.
061: *
062: * @author Abel Muinho
063: * @since 1.0
064: */
065: public class Query {
066:
067: /** Reference to the list of steps in the "result" specification. */
068: private List returnClause;
069:
070: /** Reference to the list of steps in the "order by" specification. */
071: private List orderByClause;
072:
073: /**
074: * Obtains the return clause.
075: * @return the return clause.
076: */
077: public List getReturnClause() {
078: return returnClause;
079: }
080:
081: /**
082: * Sets the return clause
083: * @param steps the return clause.
084: */
085: public void setReturnClause(List steps) {
086: returnClause = steps;
087: }
088:
089: /**
090: * Gets the order by clause.
091: * @return the order by clause.
092: */
093: public List getOrderByClause() {
094: return orderByClause;
095: }
096:
097: /**
098: * Sets the order by clause.
099: * @param steps the order by clause.
100: */
101: public void setOrderByClause(List steps) {
102: orderByClause = steps;
103: }
104: }
|