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

java.lang.Object
  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 Object
implements SCSSFunctionGenerator

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 functionName)
           
 
Method Summary
 SassListItem compute(LexicalUnitImpl function)
          Computes the value of the function.
protected abstract  LexicalUnitImpl computeForParam(LexicalUnitImpl firstParam)
          Compute the value of the function.
 String getFunctionName()
          Returns function name handled by this generator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractSingleParameterFunctionGenerator

public AbstractSingleParameterFunctionGenerator(String functionName)
Method Detail

getFunctionName

public String getFunctionName()
Description copied from interface: SCSSFunctionGenerator
Returns function name handled by this generator. Default generator returns null and is used if there is no dedicated generator for given function.

Specified by:
getFunctionName in interface SCSSFunctionGenerator
Returns:

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.

Specified by:
compute in interface SCSSFunctionGenerator
Parameters:
function - Function lexical unit to print its state
Returns:
SassListItem the value of the function

computeForParam

protected abstract LexicalUnitImpl computeForParam(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:
firstParam -
Returns:


Copyright © 2013–2014 Vaadin. All rights reserved.