001: /*
002: * ============================================================================
003: * GNU Lesser General Public License
004: * ============================================================================
005: *
006: * JasperReports - Free Java report-generating library.
007: * Copyright (C) 2001-2006 JasperSoft Corporation http://www.jaspersoft.com
008: *
009: * This library is free software; you can redistribute it and/or
010: * modify it under the terms of the GNU Lesser General Public
011: * License as published by the Free Software Foundation; either
012: * version 2.1 of the License, or (at your option) any later version.
013: *
014: * This library is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
017: * Lesser General Public License for more details.
018: *
019: * You should have received a copy of the GNU Lesser General Public
020: * License along with this library; if not, write to the Free Software
021: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
022: *
023: * JasperSoft Corporation
024: * 303 Second Street, Suite 450 North
025: * San Francisco, CA 94107
026: * http://www.jaspersoft.com
027: */
028: package net.sf.jasperreports.engine;
029:
030: /**
031: * @author Teodor Danciu (teodord@users.sourceforge.net)
032: * @version $Id: JRExpression.java 1229 2006-04-19 10:27:35Z teodord $
033: */
034: public interface JRExpression {
035:
036: /**
037: * A constant specifying that an expression should be evaluated at the exact moment in the filling process
038: * when it is encountered.
039: */
040: public static final byte EVALUATION_TIME_NOW = 1;
041:
042: /**
043: * A constant specifying that an expression should be evaluated at the end of the filling process.
044: */
045: public static final byte EVALUATION_TIME_REPORT = 2;
046:
047: /**
048: * A constant specifying that an expression should be evaluated after each page is filled.
049: */
050: public static final byte EVALUATION_TIME_PAGE = 3;
051:
052: /**
053: * A constant specifying that an expression should be evaluated after each column is filled.
054: */
055: public static final byte EVALUATION_TIME_COLUMN = 4;
056:
057: /**
058: * A constant specifying that an expression should be evaluated after each group break.
059: */
060: public static final byte EVALUATION_TIME_GROUP = 5;
061:
062: /**
063: * The element will be evaluated at band end.
064: */
065: public static final byte EVALUATION_TIME_BAND = 6;
066:
067: /**
068: * Evaluation time indicating that each variable participating in the expression
069: * should be evaluated at a time decided by the engine.
070: * <p/>
071: * Variables will be evaluated at a time corresponding to their reset type.
072: * Fields are evaluated "now", i.e. at the time the band the element lies on gets filled.
073: * <p/>
074: * This evaluation type should be used when report elements having expressions that combine
075: * values evaluated at different times are required (e.g. percentage out of a total).
076: * <p/>
077: * NB: avoid using this evaluation type when other types suffice as it can lead
078: * to performance loss.
079: */
080: public static final byte EVALUATION_TIME_AUTO = 7;
081:
082: /**
083: *
084: */
085: public static final byte EVALUATION_OLD = 1;
086: public static final byte EVALUATION_ESTIMATED = 2;
087: public static final byte EVALUATION_DEFAULT = 3;
088:
089: /**
090: * Dummy ID that is assigned to expression that are not used (and not collected).
091: */
092: public static final Integer NOT_USED_ID = new Integer(-1);
093:
094: /**
095: * Returns the expression return value class.
096: */
097: public Class getValueClass();
098:
099: /**
100: * Returns the expression return value class.
101: */
102: public String getValueClassName();
103:
104: /**
105: *
106: */
107: public int getId();
108:
109: /**
110: *
111: */
112: public JRExpressionChunk[] getChunks();
113:
114: /**
115: *
116: */
117: public String getText();
118:
119: }
|