org.eclipse.cdt.core.envvar

## Class EnvironmentVariable

- java.lang.Object
- - org.eclipse.cdt.core.envvar.EnvironmentVariable

All Implemented Interfaces:
  Cloneable, IEnvironmentVariable

Direct Known Subclasses:
  StorableEnvVar

    public class EnvironmentVariable
    extends Object
    implements IEnvironmentVariable, Cloneable

A trivial implementation of `IEnvironmentVariable`

Since:
  3.0

### Field Summary

Fields
`protected String` `fDelimiter`
`protected String` `fName`
`protected int` `fOperation`
`protected String` `fValue`

### Fields inherited from interface org.eclipse.cdt.core.envvar.IEnvironmentVariable

`ENVVAR_APPEND, ENVVAR_PREPEND, ENVVAR_REMOVE, ENVVAR_REPLACE`

### Constructor Summary

Constructors
`protected` `EnvironmentVariable()`
`` `EnvironmentVariable(IEnvironmentVariable var)`
`` `EnvironmentVariable(String name)`
`` `EnvironmentVariable(String name, String value)`
`` `EnvironmentVariable(String name, String value, int op, String delimiter)`
`` `EnvironmentVariable(String name, String value, String delimiter)`

### Method Summary

All Methods Instance Methods Concrete Methods
`Object` `clone()`
`boolean` `equals(Object obj)`
`String` `getDelimiter()`
`String` `getName()`
`int` `getOperation()`
`String` `getValue()`
`int` `hashCode()`
`String` `toString()`

### Methods inherited from class java.lang.Object

`finalize, getClass, notify, notifyAll, wait, wait, wait`

### Field Detail

#### fName

    protected String fName

#### fValue

    protected String fValue

#### fDelimiter

    protected String fDelimiter

#### fOperation

    protected int fOperation

### Constructor Detail

#### EnvironmentVariable

    public EnvironmentVariable(String name,
                               String value,
                               int op,
                               String delimiter)

#### EnvironmentVariable

    protected EnvironmentVariable()

#### EnvironmentVariable

    public EnvironmentVariable(String name)

#### EnvironmentVariable

    public EnvironmentVariable(String name,
                               String value)

#### EnvironmentVariable

    public EnvironmentVariable(String name,
                               String value,
                               String delimiter)

#### EnvironmentVariable

    public EnvironmentVariable(IEnvironmentVariable var)

### Method Detail

#### getName

    public String getName()

Specified by:
  `getName` in interface `IEnvironmentVariable`
Returns:
  the variable name

#### getValue

    public String getValue()

Specified by:
  `getValue` in interface `IEnvironmentVariable`
Returns:
  the variable value

#### getOperation

    public int getOperation()

Specified by:
  `getOperation` in interface `IEnvironmentVariable`
Returns:
  one of the IBuildEnvironmentVariable.ENVVAR_* operation types

#### getDelimiter

    public String getDelimiter()

Specified by:
  `getDelimiter` in interface `IEnvironmentVariable`
Returns:
  if the variable can hold the list of values this method returns the String representing the delimiter that is used to separate values. This information is used for the following: 1. in append and prepend operations: If the variable already exists and contains some value the new value will be calculated in the following way: For the "prepend" operation: <New value> = <the value from the getValue() method><delimiter><Old value> For the "append" operation: <New value> = <Old value><delimiter><the value from the getValue() method> The Environment Variable Provider will also remove the duplicates of "sub-values" in the resulting value. For example: If the current value is "string1:string2:string3", the getDelimiter() method returns ":" and getValue() method returns "string4:string2" the new value will contain: For the "prepend" operation: "string4:string2:string1:string3" For the "append" operation: "string1:string3:string4:string2" 2. Since the environment variables are also treated as build macros the delimiter is also used by the BuildMacroProvider to determine the type of the macro used to represent the given environment variable. If the variable has the delimiter it is treated as the Text-List macro otherwise it is treated as the Text macro. (See Build Macro design for more details) To specify that no delimiter should be used, the getDelimiter() method should return null or an empty string

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### equals

    public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

#### clone

    public Object clone()

Overrides:
  `clone` in class `Object`