Add a modifier.
@param modifier the modifier to add.
486426
public void addModifier(String modifier) {
		if (!Strings.isEmpty(modifier)) {
			this.sarlBehavior.getModifiers().add(modifier);
		}
	}
678450
private JsonNode applyShapeModifier(JsonNode node, ShapeModifier modifier) {
        if (node == null || modifier == null) {
            return node;
        }

        if (modifier.getExclude() == null && modifier.getModify() == null) {
            return node;
        }

        if (!node.isObject()) return node;

        final ObjectNode obj = (ObjectNode) node;

        ObjectNode modified = MAPPER.createObjectNode();
        // Filter any excluded members
        final List<String> excludes = modifier.getExclude() != null ? modifier.getExclude() : Collections.emptyList();
        obj.fieldNames().forEachRemaining(m -> {
            if (!excludes.contains(m)) {
                modified.set(m, obj.get(m));
            }
        });
        // Apply property renames
        final List<Map<String, ShapeModifier_ModifyModel>> modify = modifier.getModify() != null ? modifier.getModify() : Collections.emptyList();
        modify.forEach(memberMods ->
            memberMods.entrySet().forEach(memberMod -> {
                String memberName = memberMod.getKey();
                ShapeModifier_ModifyModel modelModify = memberMod.getValue();
                if (modelModify.getEmitPropertyName() != null) {
                    String newName = modelModify.getEmitPropertyName();
                    modified.set(newName, modified.get(memberName));
                    modified.remove(memberName);
                    memberName = newName;
                }
            })
        );

        return modified;
    }
287078
public static int toModifiers(final String modifiers) {
        if (modifiers == null) {
            return 0;
        }
        final String trimmedModifiers = modifiers.trim();
        int modifier = 0;
        final StringTokenizer tok = new StringTokenizer(trimmedModifiers, " ");
        while (tok.hasMoreTokens()) {
            final String mod = tok.nextToken();
            modifier = modifier | modifierValueForName(mod);
        }
        return modifier;
    }
1195272
public void add(final Modulo2Equation equation) {
			int i = 0, j = 0, k = 0;
			final int s = variables.size(), t = equation.variables.size();
			final int[] a = variables.elements(), b = equation.variables.elements(), result = new int[s + t];

			if (t != 0 && s != 0) {
				for (;;) {
					if (a[i] < b[j]) {
						result[k++]  = a[i++];
						if (i == s) break;
					}
					else if (a[i] > b[j]) {
						result[k++]  = b[j++];
						if (j == t) break;
					}
					else {
						i++;
						j++;
						if (i == s) break;
						if (j == t) break;
					}
				}
			}

			while (i < s) result[k++] = a[i++];
			while (j < t) result[k++] = b[j++];

			c ^= equation.c;
			variables.size(k);
			System.arraycopy(result, 0, variables.elements(), 0, k);
		}
708379
public void defineField(int modifier, String fieldName, TypeMirror type)
    {
        DeclaredType dt = (DeclaredType)asType();
        VariableBuilder builder = new VariableBuilder(this, fieldName, dt.getTypeArguments(), typeParameterMap);
        builder.addModifiers(modifier);
        builder.setType(type);
        FieldInfo fieldInfo = new FieldInfo(this, builder.getVariableElement());
        addFieldInfo(fieldInfo);
        fieldInfo.readyToWrite();
    }
762694
protected void addModifiers(MemberDoc member, Content htmltree) {
        String mod = modifierString(member);
        // According to JLS, we should not be showing public modifier for
        // interface methods.
        if ((member.isField() || member.isMethod()) &&
            writer instanceof ClassWriterImpl &&
            ((ClassWriterImpl) writer).getClassDoc().isInterface()) {
            // This check for isDefault() and the default modifier needs to be
            // added for it to appear on the method details section. Once the
            // default modifier is added to the Modifier list on DocEnv and once
            // it is updated to use the javax.lang.model.element.Modifier, we
            // will need to remove this.
            mod = (member.isMethod() && ((MethodDoc)member).isDefault()) ?
                    Util.replaceText(mod, "public", "default").trim() :
                    Util.replaceText(mod, "public", "").trim();
        }
        if(mod.length() > 0) {
            htmltree.addContent(mod);
            htmltree.addContent(writer.getSpace());
        }
    }
1327302
function addDiffIndicator(str, added) {
    const modifier = added ? '+' : '-';
    if (str[0] === ' ') {
        return modifier + str.slice(1);
    } else {
        return `${modifier}${str}`;
    }
}
603707
private void preprocess_ModifyShapeMembers(ServiceModel serviceModel, Shape shape, ShapeModifier modifier) {

        if (modifier.getModify() != null) {
            for (Map<String, ShapeModifier_ModifyModel> modifies : modifier.getModify()) {
                for (Entry<String, ShapeModifier_ModifyModel> entry : modifies.entrySet()) {

                    String memberToModify = entry.getKey();
                    ShapeModifier_ModifyModel modifyModel = entry.getValue();

                    doModifyShapeMembers(serviceModel, shape, memberToModify, modifyModel);
                }
            }
        }

        if (modifier.getExclude() != null) {
            for (String memberToExclude : modifier.getExclude()) {

                if (shape.getRequired() != null &&
                    shape.getRequired().contains(memberToExclude)) {
                    throw new IllegalStateException(
                            "ShapeModifier.exclude customization found for "
                                    + memberToExclude
                                    + ", but this member is marked as required in the model!");
                }

                if (shape.getMembers() != null) {
                    shape.getMembers().remove(memberToExclude);
                }
            }
        }

        if (modifier.getInject() != null) {
            for (Map<String, Member> injects : modifier.getInject()) {
                if (shape.getMembers() == null) {
                    shape.setMembers(new HashMap<>());
                }
                shape.getMembers().putAll(injects);
            }
        }

        if (modifier.getInjectEnumValues() != null) {
            if (shape.getEnumValues() == null) {
                throw new IllegalStateException("Attempted to add enum members to a non-enum shape!");
            }
            Set<String> extendValues = new HashSet<>(shape.getEnumValues());
            extendValues.addAll(modifier.getInjectEnumValues());
            shape.setEnumValues(new ArrayList<>(extendValues));
        }
    }
184079
public static boolean hasModifier(Constructor<?> constructor, ModifierType... modifierTypes) {
		if (null == constructor || ArrayUtil.isEmpty(modifierTypes)) {
			return false;
		}
		return 0 != (constructor.getModifiers() & modifiersToInt(modifierTypes));
	}
812277
public static <T extends Executable> Predicate<T> executableModifierIs(final int modifier) {
        return candidate -> (candidate.getModifiers() & modifier) != 0;
    }
397851
public void defineField(int modifier, String fieldName, Class<?> type)
    {
        defineField(modifier, fieldName, Typ.getTypeFor(type));
    }
211885
public static boolean hasModifier(Method method, ModifierType... modifierTypes) {
		if (null == method || ArrayUtil.isEmpty(modifierTypes)) {
			return false;
		}
		return 0 != (method.getModifiers() & modifiersToInt(modifierTypes));
	}
76603
static void modifiersToString(final int modifiers, final StringBuilder buf) {
        if ((modifiers & Modifier.FINAL) != 0) {
            buf.append("final ");
        }
        if ((modifiers & 0x1000) != 0) {
            buf.append("synthetic ");
        }
        if ((modifiers & 0x8000) != 0) {
            buf.append("mandated ");
        }
    }
731931
public void addModifier(Modifier modifier) {
		if (modifier != null) {
			final String ruleName = modifier.getType();
			if (!Strings.isEmpty(ruleName)) {
				List<String> modifiers = this.modifiers.get(ruleName);
				if (modifiers == null) {
					modifiers = new ArrayList<>();
					this.modifiers.put(ruleName, modifiers);
				}
				modifiers.addAll(modifier.getModifiers());
			}
		}
	}
1368797
public static Predicate<Class<?>> hasModifiers(final Integer modifiers) {
        return clazz -> (modifiers & clazz.getModifiers()) == modifiers;
    }
595150
public function removeModifier($modifier)
	{
		if (in_array($modifier, $this->modifiers))
		{
			unset($this->modifiers[$modifier]);
		}

		return $this;
	}
863459
function addStateModifier() {
    var modifier = new StateModifier({
        size: [undefined, 100],
        align: [0.7, 0.5],
        origin: [0.5, 0.5],
        proportions: [0.2, 1],
        opacity: 0.5
        //transform: Transform.thenMove(Transform.rotateZ(Math.PI / 3), [200, 50, 0])
    });

    modifier.setAlign(
        [0.5, 0.5],
        { duration: 1000, curve: Easing.inExpo },
        function() {
            modifier.setTransform(
                Transform.thenMove(Transform.rotateZ(Math.PI / 3), [50, 50, 0]),
                { duration: 800, curve: Easing.inExpo }
            );
        }
    );

    var surface = new Surface({
        content: 'HI',
        properties: {
            backgroundColor: 'red',
            color: 'white',
            textAlign: 'center',
            fontSize: '40px',
            borderRadius: '10px'
        }
    });

    ctx.add(modifier).add(surface);
}