public boolean hasVisited(int index) { for (int i=0;i<visited.$length();i++) { if (visited.$get(i).intValue() == index) return true; } return false; }
/** * Return the GUID portion of the short ID. * * @return {string} Guid of the linked data object. * @method getGuid */ public String getGuid() { String shortId = trimVersionFromUrl(id); Array<String> parts = (Array<String>) (Object) shortId.split("/"); return parts.$get(parts.$length() - 1); }
/** * Returns true if the provided ID represents a competency in this packet. * * @param competencyId * @return */ public boolean hasId(String competencyId) { for (int i = 0; i < competency.$length(); i++) if (competency.$get(i).isId(competencyId)) return true; return false; }
/** * Returns true if all sub packets have the false or unknown result. * * @return */ public boolean allSubPacketsFalseOrUnknown() { for (int i = 0; i < subPackets.$length(); i++) { if (ResultType.TRUE.equals(subPackets.$get(i).result) || ResultType.INDETERMINANT.equals(subPackets.$get(i).result)) return false; } return true; }
@Override public void $invoke(Object p1) { Array<String> ary = (Array<String>) p1; me.adminKeys = new Array(); for (int i = 0; i < ary.$length(); i++) { me.adminKeys.push(ary.$get(i)); } success.$invoke(ary); } }, new Callback1<String>() {
private void addAssertionsToList(Array<EcAssertion> repoAssertions) { for (int i = 0; i < repoAssertions.$length(); i++) { assertionList.push(repoAssertions.$get(i)); } repostioriesQueried++; }
private boolean processChildPackets(Array<InquiryPacket> childPackets) { if (childPackets != null) for (int i = 0; i < childPackets.$length(); i++) if (continueProcessingFirstPass(childPackets.$get(i))) return true; // TB - not sure why this return was here // FR - The return is here because we don't want to process // multiple things at the same time, as it locks up the UI // thread and spams the log with async data. // FR - "drip processing" makes the logs more readable and will // interrupt the UI thread less. return false; }
public boolean isIn(InquiryPacket ip, Array<InquiryPacket> alreadyDone) { for (int i = 0; i < alreadyDone.$length(); i++) if (ip == alreadyDone.$get(i)) return true; return false; }
private void parseCompetencies(Array<EcRemoteLinkedData> rlda) { competencyArray = new Array<EcCompetency>(); EcCompetency c; for (int i = 0; i < rlda.$length(); i++) { //if ("competency".equalsIgnoreCase(rlda.$get(i).type)) { if (rlda.$get(i).isAny(new EcCompetency().getTypes())) { c = new EcCompetency(); c.copyFrom(rlda.$get(i)); competencyArray.push(c); } } }
public void mergeNodePackets(NodePacket packet1, NodePacket packet2) { if (packet1 != packet2) { Node n; Array<Node> na = packet2.getNodeList(); for (int i=0;i<na.$length();i++) { n = na.$get(i); packet1.addNode(n); nodePacketMap.$put(n.getId(),packet1); } nodePacketList = ArrayUtil.arrayRemove(nodePacketList,packet2); } }
private void startFindCycles(NodeRelationMap relationMap, NodePacketGraph npg) { Array<Node> nodeList = relationMap.getNodeList(); for (int i=0;i<nodeList.$length();i++) { visitedNodes = new Array<Node>(); //this may be something we can change for efficiency...I was alternating between these two to see if there was any difference... //if (!nodesProcessed.contains(n)) findCycles(n,relationMap,npg,new ArrayList<Node>()); findCycles(nodeList.$get(i),relationMap,npg); } }
public void update(int nodeIndex, double change, boolean positive) { double a = alphas.$get(nodeIndex); double b = betas.$get(nodeIndex); if (positive) alphas.$set(nodeIndex, a+change); else betas.$set(nodeIndex,b+change); activations.$set(nodeIndex,(a+(positive ? change : 0))/(a+b+change)); updated.$set(nodeIndex,true); }
private boolean processChildPacketsSecondPass(Array<InquiryPacket> childPackets) { if (childPackets != null) for (int i = 0; i < childPackets.$length(); i++) if (continueProcessingSecondPass(childPackets.$get(i))) return true; return false; }
private boolean hasOrOperation() { for (int i = 0; i < queryOperations.$length(); i++) { if (OperationType.OR.equals(queryOperations.$get(i))) return true; } return false; }
private NodeRelationMap buildBroadensRequiresEqualsMap(NodeGraph graph) { NodeRelationMap relationMap = new NodeRelationMap(); Node n; Array<Node> nodeList = graph.getNodeList(); for (int i=0;i<nodeList.$length();i++) { n = nodeList.$get(i); relationMap.addNodeRelations(n,graph.getBroadensRequiresEqualsRelationListForNode(n)); } return relationMap; }
private Array<Integer> cloneVisited() { Array<Integer> newVis = new Array<Integer>(); //Integer newI; for (int i=0;i<visited.$length();i++) { //newI = new Integer(visited.$get(i)); //newVis.push(newI); newVis.push(visited.$get(i)); } return newVis; }
public static boolean arrayContains(Array a, Object o) { for (int i=0;i<a.$length();i++) { if (a.$get(i) == o) return true; } return false; }
private EbacEncryptedSecret tryDecryptSecretByKeyAndIndex(EcPpk decryptionKey, int j) { String decryptedSecret = null; decryptedSecret = EcRsaOaep.decrypt(decryptionKey, this.secret.$get(j)); if (EcLinkedData.isProbablyJson(decryptedSecret)) { EbacEncryptedSecret encryptedSecret = EbacEncryptedSecret.fromEncryptableJson(JSGlobal.JSON.parse(decryptedSecret)); return encryptedSecret; } return null; }