tracesrv/tracecompiler/src/com.nokia.tracecompiler/src/com/nokia/tracecompiler/engine/header/TemplateChoice.java
changeset 56 aa2539c91954
equal deleted inserted replaced
54:a151135b0cf9 56:aa2539c91954
       
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 * Template iterator
       
    17 *
       
    18 */
       
    19 package com.nokia.tracecompiler.engine.header;
       
    20 
       
    21 /**
       
    22  * If-check in template
       
    23  * 
       
    24  */
       
    25 class TemplateChoice {
       
    26 
       
    27 	/**
       
    28 	 * Templates to be used if check is true
       
    29 	 */
       
    30 	private Object[] templateTrue;
       
    31 
       
    32 	/**
       
    33 	 * Templates to be used if check is false
       
    34 	 */
       
    35 	private Object[] templateFalse;
       
    36 
       
    37 	/**
       
    38 	 * Choice class
       
    39 	 */
       
    40 	private Class<? extends TemplateCheckBase> choiceClass;
       
    41 
       
    42 	/**
       
    43 	 * Constructors
       
    44 	 * 
       
    45 	 * @param choiceClass
       
    46 	 *            the class which does the check
       
    47 	 * @param templateTrue
       
    48 	 *            the template to be used if check is true
       
    49 	 * @param templateFalse
       
    50 	 *            the template to be used if check is false
       
    51 	 */
       
    52 	TemplateChoice(Class<? extends TemplateCheckBase> choiceClass,
       
    53 			Object[] templateTrue, Object[] templateFalse) {
       
    54 		this.choiceClass = choiceClass;
       
    55 		this.templateTrue = templateTrue;
       
    56 		this.templateFalse = templateFalse;
       
    57 	}
       
    58 
       
    59 	/**
       
    60 	 * Gets the choice class
       
    61 	 * 
       
    62 	 * @return the class
       
    63 	 */
       
    64 	Class<? extends TemplateCheckBase> getChoiceClass() {
       
    65 		return choiceClass;
       
    66 	}
       
    67 
       
    68 	/**
       
    69 	 * Gets the template if choice returns true
       
    70 	 * 
       
    71 	 * @return the template
       
    72 	 */
       
    73 	Object[] getTrueTemplate() {
       
    74 		return templateTrue;
       
    75 	}
       
    76 
       
    77 	/**
       
    78 	 * Gets the template if choice returns false
       
    79 	 * 
       
    80 	 * @return the template
       
    81 	 */
       
    82 	Object[] getFalseTemplate() {
       
    83 		return templateFalse;
       
    84 	}
       
    85 
       
    86 }