public void removeStatementsFromEffectiveSubstatements( final Collection<? extends StmtContext<?, ?, ?>> statements) { if (!effective.isEmpty()) { effective.removeAll(statements); shrinkEffective(); } }
public void removeStatementFromEffectiveSubstatements(final StatementDefinition statementDef) { if (effective.isEmpty()) { return; } final Iterator<? extends StmtContext<?, ?, ?>> iterator = effective.iterator(); while (iterator.hasNext()) { final StmtContext<?, ?, ?> next = iterator.next(); if (statementDef.equals(next.getPublicDefinition())) { iterator.remove(); } } shrinkEffective(); }
/** * Removes a statement context from the effective substatements based on its statement definition (i.e statement * keyword) and raw (in String form) statement argument. The statement context is removed only if both statement * definition and statement argument match with one of the effective substatements' statement definition * and argument. * * <p> * If the statementArg parameter is null, the statement context is removed based only on its statement definition. * * @param statementDef statement definition of the statement context to remove * @param statementArg statement argument of the statement context to remove */ public void removeStatementFromEffectiveSubstatements(final StatementDefinition statementDef, final String statementArg) { if (statementArg == null) { removeStatementFromEffectiveSubstatements(statementDef); } if (effective.isEmpty()) { return; } final Iterator<Mutable<?, ?, ?>> iterator = effective.iterator(); while (iterator.hasNext()) { final Mutable<?, ?, ?> next = iterator.next(); if (statementDef.equals(next.getPublicDefinition()) && statementArg.equals(next.rawStatementArgument())) { iterator.remove(); } } shrinkEffective(); }