Return the selected feature if there is 1 selected feature.

@return the selected feature or null if none or multiple features are selected
549865
public String getSelectedFeature() {
		if (getNrSelectedFeatures() == 1) {
			for (VectorLayer layer : getVectorLayers()) {
				if (layer.getSelectedFeatures().size() > 0) {
					return layer.getSelectedFeatures().iterator().next();
				}
			}
		}
		return null;
	}
787872
public int getFeaturePosition(AbstractFeature feature) {
        AbstractFeature result = feature;
        if (!featurePositions.containsKey(feature)) {
            if (feature instanceof FeatureGroup) {
                FeatureGroup featureGroup = (FeatureGroup) feature;
                List<Feature> features = featureGroup.getConcreteFeatures();
                if (!features.isEmpty()) {
                    Collections.sort(features, new Comparator<Feature>() {
                        @Override
                        public int compare(Feature feat1, Feature feat2) {
                            return getFeaturePosition(feat1) - getFeaturePosition(feat2);
                        }
                    });
                    result = features.get(0);
                }
            }
        }
        return featurePositions.getOrDefault(result, 0);
    }
847630
public Map<String, Feature> feature() {
        if (this.feature == null) {
            this.feature = new LinkedHashMap<String, Feature>();
        }
        return this.feature;
    }
372298
protected int getCurrentSelection() {
        if (mCurrentProfile != null && mProfiles != null) {
            int i = 0;
            for (IProfile profile : mProfiles) {
                if (profile == mCurrentProfile) {
                    return i;
                }
                i++;
            }
        }
        return -1;
    }
1165015
public int getIndex(String feature)
	{
		//logger.debug("FeatureIndex.get : " + feature + "(" + count + ")");
		Integer index = (Integer) map.get(feature);

		if (index == null)
			return -1;

		return index.intValue();
	}
269622
public E getSelectedEnum ()
    {
        int selidx = getSelectedIndex();
        return (selidx < 0) ? null : Enum.valueOf(_eclass, getValue(selidx));
    }
644622
public int getNrSelectedFeatures() {
		int count = 0;
		for (VectorLayer layer : getVectorLayers()) {
			count += layer.getSelectedFeatures().size();
		}
		return count;
	}
215870
public static <T> T getRandomSelection(T... options) {
        if (options == null || options.length == 0) {
            if (tc.isDebugEnabled()) {
                Tr.debug(tc, "No options provided to random selection, returning null");
            }
            return null;
        }
        if (options.length == 1) {
            if (tc.isDebugEnabled()) {
                Tr.debug(tc, "Only one option provided to random selection, returning it: [" + options[0] + "]");
            }
            return options[0];
        }

        Random rand = new Random();
        Integer index = rand.nextInt(options.length);

        T entry = options[index];
        if (tc.isDebugEnabled()) {
            Tr.debug(tc, "Chose random selection: [" + ((entry == null) ? null : entry) + "]");
        }
        return entry;
    }
205340
public int ensureFeature(String featureName) {
        int feature = featureToIndex.getOrDefault(featureName, -1);
        if (feature == -1) {
            synchronized (featureToIndex) {
                feature = featureToIndex.getOrDefault(featureName, -1);
                if (feature == -1) {
                    feature = featureToIndex.size();
                    featureToIndex.put(featureName, feature);
                }
            }
        }
        return feature;
    }
743047
public Integer getSelectedColumn() {
        final Object result = getStateHelper().eval(PropertyKeys.selectedColumn);
        if (result == null) {
            return null;
        }
        return Integer.valueOf(result.toString());
    }
82846
public long getCurrentSelection() {
        IDrawerItem drawerItem = mDrawerBuilder.getDrawerItem(getCurrentSelectedPosition());
        if (drawerItem != null) {
            return drawerItem.getIdentifier();
        }
        return -1;
    }
254201
public Boolean selected(String name) {
        if (this.selected == null) {
            return null;
        } else {
            return selected.get(name);
        }
    }
38803
@SuppressWarnings("unchecked")
    public <T> T getSelect(final SelectBuilder _selectBldr)
        throws EFapsException
    {
        final OneSelect oneselect = this.selectStmt2OneSelect.get(_selectBldr.toString());
        return oneselect == null ? null : (T) oneselect.getObject();
    }
641242
def get_selected(self):
        
        if self.multi_select:
            return_tuples = []
            for selected in self.all_selected:
                return_tuples.append((self.options[selected], selected))
            return return_tuples
        else:
            return self.options[self.index], self.index
110798
function(oTable) {
			var sSelectionMode = oTable ? oTable.getSelectionMode() : SelectionMode.None;
			return sSelectionMode === SelectionMode.MultiToggle && oTable.getEnableSelectAll();
		}
173759
public Feature getFeature() {
		for (AttributeInfo info : layer.getLayerInfo().getFeatureInfo().getAttributes()) {
			featureForm.fromForm(info.getName(), feature.getAttributes().get(info.getName()));
		}
		return feature;
	}
665460
public T getFirst() {
        Optional<Rsp<T>> retval=values().stream().filter(rsp -> rsp.getValue() != null).findFirst();
        return retval.isPresent()? retval.get().getValue() : null;
    }