com.dfamaj.textproc.xwm
Class DefaultXwmContext

java.lang.Object
  extended by com.dfamaj.textproc.xwm.DefaultXwmContext
All Implemented Interfaces:
ThreadUnsafe, XwmContext, java.io.Serializable, java.lang.Cloneable

public class DefaultXwmContext
extends java.lang.Object
implements ThreadUnsafe, java.io.Serializable, java.lang.Cloneable

contexte de macros pour un moteur XWM, avec les primitives de base.

Since:
2.0
Version:
2.0 -- 2007-02-01 -- $Revision$
Author:
David Andriana
See Also:
Serialized Form

Constructor Summary
DefaultXwmContext()
          constructeur à vide.
 
Method Summary
 void addDefinedTokens(Token[] tokens, XwmMacroDefinition macroDefinition)
          
rajoute des tokens définis au contexte.
 void addMacro(java.lang.String macroname, XwmMacroDefinition macroDefinition)
          rajoute une macro au contexte.
 java.lang.Object clone()
          
renvoie une copie de ce XwmContext.
 int countDefinedTokensStartingWithToken(Token token)
          
renvoie le nombre de tokens définis qui commencent par le token demandé.
 int countDefinedTokensStartingWithTokens(Token[] tokens)
          
renvoie le nombre de tokens définis qui commencent par les tokens demandés.
 XwmDefinedTokens getDefinedTokens(Token token)
          
renvoie le XwmDefinedTokens qui correspond au seul token demandé, ou null s'il n'y en a pas.
 XwmDefinedTokens getDefinedTokens(Token[] tokens)
          
renvoie le XwmDefinedTokens qui correspond aux tokens demandés, ou null s'il n'y en a pas.
 XwmMacro getMacro(java.lang.String macroname)
          renvoie la macro avec un nom donné, ou null.
 boolean hasDefinedTokensStartingWithToken(Token token)
          
renvoie true si des tokens définis commencent par le token demandé.
 boolean isTokensPrimitive(Token token)
          
renvoie true si le Token correspond à la primitive "\tokens".
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultXwmContext

public DefaultXwmContext()
constructeur à vide.

Method Detail

addDefinedTokens

public final void addDefinedTokens(Token[] tokens,
                                   XwmMacroDefinition macroDefinition)
rajoute des tokens définis au contexte.

Specified by:
addDefinedTokens in interface XwmContext

addMacro

public final void addMacro(java.lang.String macroname,
                           XwmMacroDefinition macroDefinition)
rajoute une macro au contexte.

Specified by:
addMacro in interface XwmContext

clone

public final java.lang.Object clone()
renvoie une copie de ce XwmContext.

Specified by:
clone in interface XwmContext
Overrides:
clone in class java.lang.Object

countDefinedTokensStartingWithToken

public final int countDefinedTokensStartingWithToken(Token token)
renvoie le nombre de tokens définis qui commencent par le token demandé.

Specified by:
countDefinedTokensStartingWithToken in interface XwmContext

countDefinedTokensStartingWithTokens

public final int countDefinedTokensStartingWithTokens(Token[] tokens)
renvoie le nombre de tokens définis qui commencent par les tokens demandés.

Specified by:
countDefinedTokensStartingWithTokens in interface XwmContext

getDefinedTokens

public final XwmDefinedTokens getDefinedTokens(Token token)
renvoie le XwmDefinedTokens qui correspond au seul token demandé, ou null s'il n'y en a pas.

Specified by:
getDefinedTokens in interface XwmContext

getDefinedTokens

public final XwmDefinedTokens getDefinedTokens(Token[] tokens)
renvoie le XwmDefinedTokens qui correspond aux tokens demandés, ou null s'il n'y en a pas.

Specified by:
getDefinedTokens in interface XwmContext

getMacro

public final XwmMacro getMacro(java.lang.String macroname)
renvoie la macro avec un nom donné, ou null.

Specified by:
getMacro in interface XwmContext

hasDefinedTokensStartingWithToken

public final boolean hasDefinedTokensStartingWithToken(Token token)
renvoie true si des tokens définis commencent par le token demandé.

Specified by:
hasDefinedTokensStartingWithToken in interface XwmContext

isTokensPrimitive

public final boolean isTokensPrimitive(Token token)
renvoie true si le Token correspond à la primitive "\tokens".

Specified by:
isTokensPrimitive in interface XwmContext