/** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * Returns a single value from the feature group which has the feature equal to the parameter. The * first found value is returned. If no value can be found then null is returned. * * @param featureGroup the featureGroup List to filter * @param filterByFeature filters by this enum * @return an instance corresponding to the feature kind or null if not found. * @generated */ @SuppressWarnings("unchecked") public static <T> T getSingleFeatureMapValue( List<NumberTypeMyComplexAbstractGroupFeatureGroup> featureGroup, Feature filterByFeature) { for (final NumberTypeMyComplexAbstractGroupFeatureGroup group : featureGroup) { if (group.getFeature() == filterByFeature) { return (T) group.getValue(); } } return null; }
/** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * Returns only the values from the feature group which have the feature equal to the parameter. * * @param featureGroup the featureGroup List to filter * @param filterByFeature filters by this enum * @return a list with instances corresponding to the feature kind * @see Collections#unmodifiableList(List) * @generated */ @SuppressWarnings("unchecked") public static <T> List<T> createUnmodifiableValueList( List<NumberTypeMyComplexAbstractGroupFeatureGroup> featureGroup, Feature filterByFeature) { final List<Object> result = new ArrayList<Object>(); for (final NumberTypeMyComplexAbstractGroupFeatureGroup group : featureGroup) { if (group.getFeature() == filterByFeature) { result.add(group.getValue()); } } return (List<T>) Collections.unmodifiableList(result); }
/** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * Creates a list of group instances set with the passed feature and values. * * @param feature the feature to set * @param values the values to set as value of each group instance in the result. * @return a list with instances of this class, set with the Feature and values * @generated */ public static List<NumberTypeMyComplexAbstractGroupFeatureGroup> createFeatureGroupList( Feature feature, List<?> values) { final List<NumberTypeMyComplexAbstractGroupFeatureGroup> result = new ArrayList<NumberTypeMyComplexAbstractGroupFeatureGroup>(); for (Object value : values) { final NumberTypeMyComplexAbstractGroupFeatureGroup group = new NumberTypeMyComplexAbstractGroupFeatureGroup(); group.setValue(feature, value); result.add(group); } return result; }
/** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * Sets a single value in a feature group, if there is already a value set in the feature for the * feature in question then it is replaced by the new value. * * @param featureGroup the featureGroup List to find the value * @param feature sets this feature * @param value the value to set * @generated */ public static void setSingleFeatureMapValue( List<NumberTypeMyComplexAbstractGroupFeatureGroup> featureGroup, Feature feature, Object value) { for (final NumberTypeMyComplexAbstractGroupFeatureGroup group : featureGroup) { if (group.getFeature() == feature) { group.setValue(feature, value); return; } } final NumberTypeMyComplexAbstractGroupFeatureGroup entry = new NumberTypeMyComplexAbstractGroupFeatureGroup(); entry.setValue(feature, value); featureGroup.add(entry); }
/** * Returns the value of '<em><b>myComplexAbstract</b></em>' feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @return the value of '<em><b>myComplexAbstract</b></em>' feature * @generated */ public ComplexNumber getMyComplexAbstract() { return NumberTypeMyComplexAbstractGroupFeatureGroup.getSingleFeatureMapValue( getMyComplexAbstractGroup(), NumberTypeMyComplexAbstractGroupFeatureGroup.Feature.MYCOMPLEXABSTRACT); }