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); }
public int getEvidenceCount() { if (evidence == null) return 0; return evidence.$length(); }
public int getEvidenceCount() { if (evidence == null) return 0; return evidence.$length(); }
@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 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 ResultType getPacketAssertionResult(InquiryPacket ip) { if (ip.positive.$length() > 0 && ip.negative.$length() == 0) return ResultType.TRUE; else if (ip.positive.$length() == 0 && ip.negative.$length() > 0) return ResultType.FALSE; else if (ip.positive.$length() > 0 && ip.negative.$length() > 0) return ResultType.INDETERMINANT; else return ResultType.UNKNOWN; }
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 Array arrayRemove(Array a, Object o) { Array retArray = new Array(); for (int i=0;i<a.$length();i++) { if (a.$get(i) != o) retArray.push(a.$get(i)); } return retArray; }
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 void validateInput() { if (includeAssertions && (repositories == null || repositories.$length() == 0)) { failure.$invoke(new ExceptionReturn("Assertion repository information not provided.")); } else if (success == null) { failure.$invoke(new ExceptionReturn("Success callback required.")); } else if (frameworkId == null) { failure.$invoke(new ExceptionReturn("Framework ID required.")); } else if (rootCompetencyId == null) { failure.$invoke(new ExceptionReturn("Root Competency ID required.")); } }
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 ResultType getPacketAssertionResult(InquiryPacket ip) { if (ip.positive.$length() > 0 && ip.negative.$length() == 0) { return ResultType.TRUE; } else if (ip.positive.$length() == 0 && ip.negative.$length() > 0) { return ResultType.FALSE; } else if (ip.positive.$length() > 0 && ip.negative.$length() > 0) { return ResultType.INDETERMINANT; } else { return ResultType.UNKNOWN; } }
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); } }