001/** 002 * ScalarGuard.java 003 * 004 * Copyright (c) 2004-2012, Nicole C. Tedesco. All rights reserved. 005 * 006 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 007 * use this file except in compliance with the License. You may obtain a copy of 008 * the License at: 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, software 013 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 014 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 015 * License for the specific language governing permissions and limitations under 016 * the License. 017 */ 018 019package net.sf.jaccumulator.lex; 020 021import net.sf.jaccumulator.scalars.SealedScalar; 022 023/** 024 * Determines whether a {@link ScalarAction} signal should be rejected or 025 * accepted within the current context of a specific model 026 * 027 * @param <MODEL> 028 * the model type to test against 029 * 030 * @since JAccumulator 4.0 031 * @author Nicole Tedesco (<a 032 * href="mailto:nicole@tedesco.name">nicole@tedesco.name</a>) 033 */ 034public interface ScalarGuard<MODEL> 035 extends 036 Guard<MODEL> 037{ 038 public boolean acceptScalar( final boolean aSignal, final MODEL aModel ); 039 040 public boolean acceptScalar( final byte aSignal, final MODEL aModel ); 041 042 public boolean acceptScalar( final char aSignal, final MODEL aModel ); 043 044 public boolean acceptScalar( final double aSignal, final MODEL aModel ); 045 046 public boolean acceptScalar( final float aSignal, final MODEL aModel ); 047 048 public boolean acceptScalar( final int aSignal, final MODEL aModel ); 049 050 public boolean acceptScalar( final long aSignal, final MODEL aModel ); 051 052 public boolean acceptScalar( 053 final SealedScalar<?> aSignal, 054 final MODEL aModel ); 055 056 public boolean acceptScalar( final short aSignal, final MODEL aModel ); 057 058 public ScalarGuard<MODEL> getScalarGuardAt( final int anIndex ) 059 throws IndexOutOfBoundsException; 060 061 public int getScalarGuardChildCount(); 062}