Package org.globus.rsl

# Class NameValue

java.lang.Object
org.globus.rsl.NameValue

Direct Known Subclasses:
  `Bindings`, `NameOpValue`

public abstract class NameValue extends Object
This class represents an attribute that is associated with multiple values.

## Field Summary

Fields
Modifier and Type
Field
Description
`protected String`
`attribute`
`protected List`
`values`

## Constructor Summary

Constructors
Constructor
Description
`NameValue(String attribute)`

## Method Summary

Modifier and Type
Method
Description
`void`
`clear()`
Removes all values associated with the attribute.
`String`
`getAttribute()`
Returns the attribute name.
`Object`
`getFirstValue()`
Returns the first value (if any) in the list.
`List`
`getValues()`
Returns the list of values.
`boolean`
`merge(NameValue nv)`
`boolean`
`remove(Object value)`
Removes a specific value from the list of values.
`void`
`setAttribute(String attrib)`
Sets the attribute name.
`void`
`setValues(List values)`
Sets the list of values.
`String`
`toRSL(boolean explicitConcat)`
Returns a RSL representation of this relation.
`abstract void`
`toRSL(StringBuffer buf, boolean explicitConcat)`
Produces a RSL representation of this relation.
`String`
`toString()`

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

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

## Field Details

### attribute

protected String attribute

### values

protected List values

## Constructor Details

### NameValue

public NameValue(String attribute)

## Method Details

### setAttribute

public void setAttribute(String attrib)
Sets the attribute name.

Parameters:
  `attrib` - the attribute name.

### setValues

public void setValues(List values)
Sets the list of values.

Parameters:
  `values` - list of values.

### getAttribute

public String getAttribute()
Returns the attribute name.

Returns:
  the attribute name.

### getValues

public List getValues()
Returns the list of values.

Returns:
  list of values.

### clear

public void clear()
Removes all values associated with the attribute.

### remove

public boolean remove(Object value)
Removes a specific value from the list of values. The value must be matched exactly to be removed from the list.

Parameters:
  `value` - value to remove.
Returns:
  true if the value was successfuly removed from the list of values. False, otherwise.

### toRSL

public String toRSL(boolean explicitConcat)
Returns a RSL representation of this relation.

Parameters:
  `explicitConcat` - if true explicit concatination will be used in RSL strings.
Returns:
  RSL representation of this relation.

### toRSL

public abstract void toRSL(StringBuffer buf, boolean explicitConcat)
Produces a RSL representation of this relation.

Parameters:
  `buf` - buffer to add the RSL representation to.
  `explicitConcat` - if true explicit concatination will be used in RSL strings.

### getFirstValue

public Object getFirstValue()
Returns the first value (if any) in the list.

Returns:
  the first value. Null, if there is no values at all.

### merge

public boolean merge(NameValue nv)

### toString

public String toString()

Overrides:
  `toString` in class `Object`