net.sourceforge.makefileparser.managers
Class VariableManager

java.lang.Object
  extended by net.sourceforge.makefileparser.managers.VariableManager

public class VariableManager
extends Object

Manages all the parsed variables

Author:
cgajo

Constructor Summary
VariableManager()
          Default constructor; sets the pre-defined variables
 
Method Summary
 boolean addNew(Variable var)
          Add new variable.
 void append(String id, String value)
          Append value to an existing variable
 void expand(String varID)
          Expand a variable
 String getValue(String id)
           
 boolean isVarDefined(String id)
           
 Iterator<String> keys()
          Get the names of all variables
 Iterator<String> nonExternalKeys()
          Get the names of all variables that are not external (= from command line)
 Iterator<String> nonNonEmptyKeys()
          Get the names of all variables whose value is not empty
 Iterator<Variable> values()
          Get the current value of the variable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VariableManager

public VariableManager()
Default constructor; sets the pre-defined variables

Method Detail

isVarDefined

public boolean isVarDefined(String id)

getValue

public String getValue(String id)

addNew

public boolean addNew(Variable var)
Add new variable. If the variable is already found, then it will be overridden. This will not happen only if the existing variable has override = true, or external = true. In this case, the variable will be overridden only if itself has override = true. external = true does not have such effect, so only the first external variable will be recognized.

Parameters:
var - the variable
Returns:
returns true if the variable was added

append

public void append(String id,
                   String value)
Append value to an existing variable


keys

public Iterator<String> keys()
Get the names of all variables


nonExternalKeys

public Iterator<String> nonExternalKeys()
Get the names of all variables that are not external (= from command line)


nonNonEmptyKeys

public Iterator<String> nonNonEmptyKeys()
Get the names of all variables whose value is not empty


values

public Iterator<Variable> values()
Get the current value of the variable


expand

public void expand(String varID)
Expand a variable



Copyright © 2009. All Rights Reserved.