Package org.apache.felix.gogo.runtime

# Class Closure

java.lang.Object
org.apache.felix.gogo.runtime.Closure

All Implemented Interfaces:
  `Evaluate`, `Function`

public class Closure extends Object implements Function, Evaluate

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`LOCATION`

## Constructor Summary

Constructors
Constructor
Description
`Closure(CommandSessionImpl session, Closure parent, CharSequence source)`

## Method Summary

Modifier and Type
Method
Description
`Object`
`eval(Token t)`
`Object`
`execute(CommandSession x, List<Object> values)`
Execute this function and return the result.
`Object`
`executeStatement(List<Token> statement)`
`Object`
`get(String name)`
`Object`
`put(String key, Object value)`
`CommandSessionImpl`
`session()`
`String`
`toString()`

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

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### LOCATION

public static final String LOCATION

See Also:
  - Constant Field Values

## Constructor Details

### Closure

public Closure(CommandSessionImpl session, Closure parent, CharSequence source) throws Exception

Throws:
  `Exception`

## Method Details

### session

public CommandSessionImpl session()

### execute

public Object execute(CommandSession x, List<Object> values) throws Exception
Description copied from interface: `Function`
Execute this function and return the result.

Specified by:
  `execute` in interface `Function`
Returns:
  the result from the execution.
Throws:
  `Exception` - if anything goes terribly wrong

### eval

public Object eval(Token t) throws Exception

Specified by:
  `eval` in interface `Evaluate`
Throws:
  `Exception`

### executeStatement

public Object executeStatement(List<Token> statement) throws Exception

Throws:
  `Exception`

### get

public Object get(String name)

Specified by:
  `get` in interface `Evaluate`

### put

public Object put(String key, Object value)

Specified by:
  `put` in interface `Evaluate`

### toString

public String toString()

Overrides:
  `toString` in class `Object`