@Override public void $invoke(EcLevel a) { if (a.competency == shortId || a.competency == id) { me.level.splice(i, 1); me.removeLevelsThatInclude(id, i, success, failure); } else me.removeLevelsThatInclude(id, i + 1, success, failure); } }, new Callback1<String>() {
@Override public void $invoke(EcAlignment a) { if (a != null && a.source == shortId || a.target == shortId || a.source == id || a.target == id) { me.relation.splice(i, 1); me.removeRelationshipsThatInclude(id, i, success, failure); } else me.removeRelationshipsThatInclude(id, i + 1, success, failure); } }, new Callback1<String>() {
/** * Deletes the specified number of elements from this <tt>Array</tt> starting at specified start index, and returns * a new <tt>Array</tt> containing the deleted elements (if any). * * <p> * If <tt>start</tt> is negative, it is treated as <tt>length+start</tt>. * * @param start * the index at which to start deleting elements. Use negative values to specified an index starting from * the end * @param deleteCount * the number of elements to be deleted * @return a new <tt>Array</tt> containing the deleted elements (if any) */ public Array<V> splice(int start, int deleteCount) { return this.splice(start, deleteCount, (V[]) null); }
/** * Prepends the specified values to the start of this <tt>Array</tt>, such that their order within this * <tt>Array</tt> is the same as the order in which they appear in the argument list. Returns the new length of this * <tt>Array</tt>. * * @param values * the values to the prepended to the start of this <tt>Array</tt> * @return the new length of this <tt>Array</tt> */ @SafeVarargs public final int unshift(V... values) { this.splice(0, 0, values); return this.$length(); }
/** * Removes the last element from this <tt>Array</tt> and returns it. * * <p> * If this <tt>Array</tt> is empty, <tt>undefined</tt> is returned. * * @return the last element from this <tt>Array</tt> */ public V pop() { if (this.length == 0) { return null; } Array<V> removed = this.splice((int) (this.length - 1), 1); return removed.$get(0); }
/** * The specified elements are appended at the end of this <tt>Array</tt> in the order in which they appear in the * arguments list and the new length of this <tt>Array</tt> is returned. * * @param values * the values to be appended * @return the new length of this <tt>Array</tt> */ @SafeVarargs public final int push(V... values) { this.splice(this.$length(), 0, values); return (int) this.length; }
@Template("array") @SafeVarargs public static <V> Array<V> $array(V... values) { Array<V> a = new Array<V>(); a.splice(0, 0, values); return a; }
/** * Removes the first element from this <tt>Array</tt> and returns it. * * <p> * If this <tt>Array</tt> is empty, <tt>null</tt> is returned. * * @return the first element of this <tt>Array</tt>. */ public V shift() { Array<V> removed = this.splice(0, 1); if (removed.$length() == 1) { return removed.$get(0); } return null; }
/*** * Removes an assertion from the envelope * @param assertionShortIdToRemove * @method removeAssertionByShortId */ public void removeAssertionByShortId(String assertionShortIdToRemove) { if (assertion != null) { for (int i=0;i<assertion.$length();i++) { if (getAssertion(i).shortId().equals(assertionShortIdToRemove)) { assertion.splice(i, 1); break; } } } if (codebook != null) { for (int i=0;i<codebook.$length();i++) { if (codebook.$get(i).assertionShortId.equals(assertionShortIdToRemove)) { codebook.splice(i, 1); break; } } } }
/** * Removes a relation ID from the framework's list of relations * * @param {String} id * ID to remove from the framework's relation list * @memberOf EcFramework * @method removeCompetency */ public void removeRelation(String id) { id = trimVersionFromUrl(id); if (relation == null) relation = new Array<String>(); for (int i = 0; i < relation.$length(); i++) if (trimVersionFromUrl(relation.$get(i)).equals(id)) relation.splice(i, 1); }
/** * Removes a rollup rule ID from the framework's list of rollup rules * * @param {String} id * ID to remove from rollup rule list * @memberOf EcFramework * @method removeRollupRule */ public void removeRollupRule(String id) { id = trimVersionFromUrl(id); if (rollupRule == null) rollupRule = new Array<String>(); for (int i = 0; i < rollupRule.$length(); i++) if (trimVersionFromUrl(rollupRule.$get(i)).equals(id)) rollupRule.splice(i, 1); }
/** * Removes a level ID from the framework's list of levels * * @param {String} id * ID to remove from framework's level list * @memberOf EcFramework * @method removeLevel */ public void removeLevel(String id) { id = trimVersionFromUrl(id); if (level == null) level = new Array<String>(); for (int i = 0; i < level.$length(); i++) if (trimVersionFromUrl(level.$get(i)).equals(id)) level.splice(i, 1); }
/** * Removes an owner from the object, if the owner does exist. * Note that this method invalidates all signatures. * * @param {EcPk} oldOwner PK to remove. * @method removeOwner */ public void removeOwner(EcPk oldOwner) { String pem = oldOwner.toPem(); if (owner == null) owner = new Array<String>(); for (int i = 0; i < owner.$length(); i++) if (owner.$get(i) == pem) owner.splice(i, 1); // Changing an owner invalidates the signatures in order to prevent // server admins from injecting owners or readers into the object. signature = null; }
public void mutateAssertions(InquiryPacket ip, Array<String> listOfCompetencies, Callback0 success) { Array<String> keys = EcObject.keys(this.assertionProcessor.assertions); for (int keyIndex = 0; keyIndex < keys.$length(); keyIndex++) { Array<EcAssertion> ary = (Array) JSObjectAdapter.$get(this.assertionProcessor.assertions, keys.$get(keyIndex)); for (int i = 0; i < ary.$length(); i++) { EcAssertion a = ary.$get(i); if (a.getAgent().toPem() == agent.toPem()) { a.confidence = a.confidence * multiplier; if (removeNoConfidence && a.confidence == 0.0) ary.splice(i--, 1); } } } success.$invoke(); } }
for (int i = 0; i < competency.$length(); i++) if (competency.$get(i).equals(shortId) || competency.$get(i).equals(id)) competency.splice(i, 1); if ((relation == null || relation.$length() == 0) && (level == null || level.$length() == 0)) if (success != null) {
d.signature.splice(i,1); } else { i++;