Example usage for org.apache.commons.collections.iterators SingletonIterator SingletonIterator

List of usage examples for org.apache.commons.collections.iterators SingletonIterator SingletonIterator

Introduction

In this page you can find the example usage for org.apache.commons.collections.iterators SingletonIterator SingletonIterator.

Prototype

public SingletonIterator(Object object, boolean removeAllowed) 

Source Link

Document

Constructs a new SingletonIterator optionally choosing if remove is a permitted operation.

Usage

From source file:org.bhave.sweeper.impl.SingleValueSweep.java

@SuppressWarnings("unchecked")
@Override//from  w w  w .  j  av a 2  s .  c  om
public Iterator<Configuration> iterator() {
    SingletonIterator it = new SingletonIterator(value, false);
    TransformIterator itConfig = new TransformIterator(it, new ConfigurationTranformer(param));

    return itConfig;
}

From source file:org.eclipse.smila.datamodel.id.impl.KeyImpl.java

/**
 * {@inheritDoc}/* w w w  . j a  v a  2s . co m*/
 * 
 * @see org.eclipse.smila.datamodel.id.Key#getKeyNames()
 */
public Iterator<String> getKeyNames() {
    if (_compositeKey == null) {
        if (_simpleKeyName == null) {
            return EmptyIterator.INSTANCE;
        } else {
            return new SingletonIterator(_simpleKeyName, false);
        }
    } else {
        return _compositeKey.keySet().iterator();
    }
}