com.vaadin.sass.internal.parser.function
Class AbstractSingleParameterFunctionGenerator

java.lang.Object
  extended by com.vaadin.sass.internal.parser.function.AbstractFunctionGenerator
      extended by com.vaadin.sass.internal.parser.function.AbstractSingleParameterFunctionGenerator
All Implemented Interfaces:
SCSSFunctionGenerator
Direct Known Subclasses:
AbsFunctionGenerator, CeilFunctionGenerator, FloorFunctionGenerator, PercentageFunctionGenerator, RoundFunctionGenerator

public abstract class AbstractSingleParameterFunctionGenerator
extends AbstractFunctionGenerator

AbstractSingleParameterFunctionGenerator is used as a base class for implementing Sass functions that take exactly one single value parameter. A single value parameter is of type LexicalUnitImpl.

Author:
Vaadin

Constructor Summary
AbstractSingleParameterFunctionGenerator(String... functionNames)
           
 
Method Summary
 SassListItem compute(LexicalUnitImpl function)
          Computes the value of the function.
protected abstract  LexicalUnitImpl computeForParam(String functionName, LexicalUnitImpl firstParam)
          Compute the value of the function.
 
Methods inherited from class com.vaadin.sass.internal.parser.function.AbstractFunctionGenerator
getFunctionNames
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractSingleParameterFunctionGenerator

public AbstractSingleParameterFunctionGenerator(String... functionNames)
Method Detail

compute

public SassListItem compute(LexicalUnitImpl function)
Description copied from interface: SCSSFunctionGenerator
Computes the value of the function. The parameters should be evaluated before this method is called. Both the input and the output of the method should be separate from any chain of lexical units.

Parameters:
function - Function lexical unit to print its state
Returns:
SassListItem the value of the function

computeForParam

protected abstract LexicalUnitImpl computeForParam(String functionName,
                                                   LexicalUnitImpl firstParam)
Compute the value of the function. This method must not modify firstParam. If necessary, the implementation should copy the parameter before making modifications.

Parameters:
functionName - The name of the function whose value is to be computed.
firstParam - The only parameter of the function.
Returns:


Copyright © 2013–2014 Vaadin. All rights reserved.