id
stringlengths
36
36
text
stringlengths
1
1.25M
b6e9a312-de59-4777-9c22-f6ff6da1caf4
public void setContactMiddleName(String middleName){ contactMiddleName.sendKeys(middleName); }
a84f7eb1-2054-4066-97c2-3ed4343ea297
public void setContactRelationDegree(String degree){ contactRelationDegree.sendKeys(degree); }
5a096a97-4cfa-4c40-adbb-349c12b56d92
public void setContactPost(String Post) { contactPost.sendKeys(Post); }
a01acb51-ee6d-4a13-8113-03e4a89cec40
public void setContactJob(String job){ contactJob.sendKeys(job); }
c95b287e-ad4c-4727-ad4e-1092c067503e
public void setContactPhoneCell(String phone) { contactPhoneCell.clear(); contactPhoneCell.sendKeys(phone); }
ce3fbfc7-7130-4aa0-9e35-11946f3a68e8
public void setGoDocumentsUpload(){ documentsUploadBtn.click(); sleep(2000); }
4ea5cc26-2532-4db8-90f3-10a67d4f2da8
public void uploadAgreement(String fileName){ String script="b=document.getElementsByTagName('input')[0];\n" + "b.style.position=\"relative\";\n" + "b.style.top=\"0\";\n" + "b.style.width=\"200px\";\n" + "b.style.height=\"20px\";\n" + "b.style.opacity=100;"; ((JavascriptExecutor)driver).executeScript(script); File file = new File(fileName); // driver.findElement(By.xpath(".//div[@class=\"step-upload_group\"][1]/input")).sendKeys(image.getAbsolutePath()); agreementUpload.sendKeys(file.getAbsolutePath()); }
426a9e45-9762-4473-a6e0-37d8678bc55d
public void uploadPassportCopy(String fileName){ String script="b=document.getElementsByTagName('input')[1];\n" + "b.style.position=\"relative\";\n" + "b.style.top=\"0\";\n" + "b.style.width=\"200px\";\n" + "b.style.height=\"20px\";\n" + "b.style.opacity=100;"; ((JavascriptExecutor)driver).executeScript(script); File file = new File(fileName); passportUpload.sendKeys(file.getAbsolutePath()); }
423ec438-f441-4eca-a1c2-1f5a06584b12
public void sendRequestToBank(){ sendButton.click(); }
39b84150-ffec-4c5a-9671-8341bafc9bb5
public WizardPage(WebDriver driver) { this.driver = driver; PageFactory.initElements(driver, this); }
a3b60211-59c6-40c1-8eed-c322611cfef6
public void open(){ driver.get(page_url); sleep(2000);//todo переписать на нормальное ожидание появление формы }
3c6e3b2e-2284-4785-83da-756572144864
public void selectConsumerCreditType(){ consumerCreditType.click(); }
8b176618-f991-43ea-a29c-ebfd4411fe92
public void setPeriod(String period){ this.period.sendKeys(period); }
c52f7bf4-0e8f-476d-bc13-46d80b8b05a2
public void setAge(String s) { age.sendKeys(s); }
4fc7dd79-6cb7-4a73-9eef-dc2f629562a8
public void setWorkType(int i) { /* TODO implement this method - by default is not necessary to fill him */ }
c93cad84-8cbe-49b2-bb80-366b77ed1f4e
public void setSalary(String sal) { salary.sendKeys(sal); }
3c08b7a1-ba38-48d1-bc2f-fbdd3a41c4db
public void waitForOffers() { //todo temp realization sleep(10000); }
5b9892f2-5e78-4c56-9241-9bf9567a3e2a
public void getSelectBankTab() { goBanks.click(); }
fc1c1b8c-a47b-45bb-b189-2dda28c02f36
public void selectTestBank() { testBankCheckbox.click(); }
829153e7-9025-485a-a432-b616d916f05c
public void getSelectAnketaTab() { goAnketa.click(); }
79962b49-0800-48d1-92c3-2fa9ea3b7120
public void getCreateNewAnketa() { createNewAnketa.click(); }
240aaeef-2590-4884-8c39-ec66746bb46c
@Parameters({"browser"}) @BeforeClass public void init(String browser){ start_session(browser); loginPage = new LoginPage(driver); wizardPage = new WizardPage(driver); }
59976766-516c-4336-b069-afe990be4f6b
@BeforeMethod public void setUp(){ loginPage.open(); loginPage.login("selenium@mailinator.com","mypassword"); wizardPage.open(); }
9c134809-5b07-461a-a530-8210c9ab40ba
@Test public void sendCreditRequestTest(){ wizardPage.selectConsumerCreditType(); wizardPage.setPeriod("60"); wizardPage.setAge("30"); wizardPage.setWorkType(1); wizardPage.setSalary("80000"); wizardPage.waitForOffers(); wizardPage.getSelectBankTab(); wizardPage.selectTestBank(); wizardPage.getSelectAnketaTab(); wizardPage.getCreateNewAnketa(); //переходим к заполнению анкеты wizardPage.setClientLastName("Иванов"); wizardPage.setClientFirstName("Иван"); wizardPage.setClientMiddleName("Иванович"); wizardPage.setClientBirthday("11.10.1986"); wizardPage.setClientBirthPlace("Урюпинск"); wizardPage.setClientPassport("1122333444"); wizardPage.setClientPassportIssued("ОВД РОВД МВД ГИБДД"); wizardPage.setClientPassportDate("11.10.2002"); wizardPage.setClientCellPhone("9111111111"); wizardPage.seClientSex("Мужской"); wizardPage.openAddressPopUP(); wizardPage.setOblast("Ленинградская"); wizardPage.setLocality("Колпино"); wizardPage.setStreet("Ленина"); wizardPage.setHouseNumber("11"); wizardPage.submitPopUpFormOkBtn(); wizardPage.openAddressFactPopUP(); wizardPage.setOblast("Ленинградская"); wizardPage.setLocality("Колпино"); wizardPage.setStreet("Ленина"); wizardPage.setHouseNumber("11"); wizardPage.submitPopUpFormOkBtn(); wizardPage.setClientJob("Рога и копыта"); wizardPage.setActivityType("ИТ"); wizardPage.setClientJoiningDate("10.2013"); wizardPage.setClientPhoneWork("4142323"); wizardPage.setClientWorkPost("Директор по развитию"); wizardPage.setClientTotalExpFromDate("10.2001"); wizardPage.setEmployeeCount("500"); wizardPage.setEmployeePhone("2342123"); wizardPage.setClientJobOrgHead("Анатолий Васюков"); wizardPage.setSupervisorName("Василий Анатольев"); wizardPage.setExperienceYear("10"); wizardPage.setExperienceMonth("5"); wizardPage.setAverSalary("50000"); wizardPage.openFactJobAddressWindow(); wizardPage.setOblast("Ленинградская"); wizardPage.setLocality("Колпино"); wizardPage.setStreet("Ленина"); wizardPage.setHouseNumber("11"); wizardPage.submitPopUpFormOkBtn(); wizardPage.openLegalJobAddressWindow(); wizardPage.setOblast("Ленинградская"); wizardPage.setLocality("Колпино"); wizardPage.setStreet("Ленина"); wizardPage.setHouseNumber("11"); wizardPage.submitPopUpFormOkBtn(); wizardPage.setEducationLevel(); wizardPage.setContactLastName("Семенов"); wizardPage.setContactFirstName("Толян"); wizardPage.setContactMiddleName("Михалыч"); wizardPage.setContactRelationDegree("Братан"); wizardPage.setContactJob("Лесопилка"); wizardPage.setContactPost("Слесарь"); wizardPage.setContactPhoneCell("9053435678"); //Переходим к загрузке документов wizardPage.setGoDocumentsUpload(); wizardPage.uploadAgreement("testFiles/agreement.doc"); wizardPage.uploadPassportCopy("testFiles/scan.jpg"); wizardPage.sendRequestToBank(); //все. в принципе, тут можно написать проверку на то, что вывелось сообщение об успех }
bb6c7257-2c01-47aa-bd27-2ec2fa31f97d
@AfterClass public void clear(){ close_session(); }
04e1ea05-f6d7-4f5d-8624-52d3664dfe9a
private MessageClient() { }
420086ce-486a-4b9e-a5c1-66ca374a884b
public static void sendMessage(final ConnectionsCount count, final Queue countQueue, final ConnectionFactory factory) throws JMSException { Connection connection = null; try { connection = factory.createConnection("test", "test123"); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); Message m = session.createObjectMessage(count); MessageProducer producer = session.createProducer(countQueue); connection.start(); producer.send(m); } catch (JMSException e) { throw new RuntimeException(e); } finally{ if(connection != null) connection.close(); } }
82c605ec-f770-4e49-b7ab-050ab4eb6a06
public static int callExtCounter(int count, String ip) { QName qname = new QName("http://client.ws.server.zadanie.com", "WServiceService"); WServiceService service = null; try { service = new WServiceService(new URL("http://localhost:8088/mockWService?wsdl"), qname); service.getWServicePort(); WService wsService = service.getWServicePort(); return wsService.addCount(count, ip); } catch (MalformedURLException e) { throw new RuntimeException(e); } }
7a65672f-9f06-4c76-9443-c0befaa6d0dd
public WServiceService(URL wsdlLocation, QName serviceName) { super(wsdlLocation, serviceName); }
554d4452-dd49-4b0a-acce-673cb9236f7b
public WServiceService() { super(WSERVICESERVICE_WSDL_LOCATION, new QName("http://client.ws.server.zadanie.com/", "WServiceMockService")); }
023333cb-fb4a-40f3-a760-33af2076d4b5
@WebEndpoint(name = "WServicePort") public WService getWServicePort() { return super.getPort(new QName("http://client.ws.server.zadanie.com/", "WServicePort"), WService.class); }
30b83a92-488e-4c9a-aadd-9c9654fe7fa4
@WebEndpoint(name = "WServicePort") public WService getWServicePort(WebServiceFeature... features) { return super.getPort(new QName("http://client.ws.server.zadanie.com/", "WServicePort"), WService.class, features); }
0250bbbe-56c4-4768-b102-0215300176a3
@WebMethod @WebResult(targetNamespace = "") @RequestWrapper(localName = "addCount", targetNamespace = "http://client.ws.server.zadanie.com/", className = "com.zadanie.server.ws.client.AddCount") @ResponseWrapper(localName = "addCountResponse", targetNamespace = "http://client.ws.server.zadanie.com/", className = "com.zadanie.server.ws.client.AddCountResponse") public int addCount( @WebParam(name = "count", targetNamespace = "") Integer count, @WebParam(name = "ip", targetNamespace = "") String ip);
156d875b-6ce7-4fff-85c6-0ebd80ce65a8
public int getReturn() { return _return; }
611fb4d7-c208-46bb-9b23-8f7910ce0249
public void setReturn(int value) { this._return = value; }
21153ac4-c02e-4fc4-b70f-e76adf317c98
public ObjectFactory() { }
edee8557-e151-4a64-95bf-8c5d2bef2912
public AddCountResponse createAddCountResponse() { return new AddCountResponse(); }
695e1a51-1d9e-486b-b772-f60bfc119188
public AddCount createAddCount() { return new AddCount(); }
fb81d50a-fd53-41ba-8ded-5fa276105454
@XmlElementDecl(namespace = "http://client.ws.server.zadanie.com/", name = "addCount") public JAXBElement<AddCount> createAddCount(AddCount value) { return new JAXBElement<AddCount>(_AddCount_QNAME, AddCount.class, null, value); }
0a57e32f-072a-4544-aa9b-9cdc026f0d25
@XmlElementDecl(namespace = "http://client.ws.server.zadanie.com/", name = "addCountResponse") public JAXBElement<AddCountResponse> createAddCountResponse(AddCountResponse value) { return new JAXBElement<AddCountResponse>(_AddCountResponse_QNAME, AddCountResponse.class, null, value); }
763c2326-aeae-4442-856b-eace46a7d5e1
public Integer getCount() { return count; }
0cace498-9d27-4864-a778-5ed796d65a90
public void setCount(Integer value) { this.count = value; }
b7a6c591-c807-4144-b1f3-b7c8ebf3c996
public String getIp() { return ip; }
aa318f47-924d-4393-8ea3-d113721083aa
public void setIp(String value) { this.ip = value; }
7ab62a08-6ab6-420e-acb6-d425b19c3d3c
@Override public void onMessage(Message m) { ObjectMessage om = (ObjectMessage) m; try { ConnectionsCount cc = (ConnectionsCount) om.getObject(); utx.begin(); em.persist(cc); utx.commit(); } catch (Exception e) { throw new RuntimeException(e); } finally{ try { utx.rollback(); } catch (Exception e) { throw new RuntimeException(e); } } }
151a711f-d334-4915-91e5-b734d199cf3a
public void addCount(ConnectionsCount count);
f59e0b37-ba9d-48d7-b73c-cc1d271c7772
@Override public void addCount(ConnectionsCount count) { if (factory != null && countQueue != null) try { MessageClient.sendMessage(count, countQueue, factory); } catch (JMSException e) { throw new RuntimeException("can not send message",e); } else{ throw new RuntimeException("Not defined factory or queue"); } if (count != null && count.getIp() != null && count.getCount() != null) WSClient.callExtCounter(count.getCount(), count.getIp()); }
f7eef38e-254c-498d-b62a-26b76b741969
@POST @Consumes("application/json") @Path("/add") public void addCount(ConnectionsCount count){ System.out.println(count.toString()); if(count.getCreationTime() == null){ count.setCreationTime(new Date()); } counterEJB.addCount(count); }
6fb25e4d-ee43-49cd-b683-d429a0742eb1
public ConnectionsCount() { super(); }
9b4a4c19-0abd-4040-b1f6-648736505a82
public Long getId() { return id; }
3499cedb-8f21-47ab-9619-370f3adeb335
public void setId(Long id) { this.id = id; }
c5dfc1fe-3d02-4640-8951-1bc9e258b06b
public String getIp() { return ip; }
e3b94337-16bd-4f53-8d8f-6b9ac5716e4b
public void setIp(String ip) { this.ip = ip; }
fb51f737-ac82-491a-950b-a31b37291613
public Date getCreationTime() { return creationTime; }
4e3aadbd-90c4-4ecf-8d38-b5a70747f9b5
public void setCreationTime(Date creationTime) { this.creationTime = creationTime; }
d6df2314-fd23-4ae1-93b3-0b8ea1a604f2
public Integer getCount() { return count; }
bc79b9ee-aff6-4792-b02c-bd8bcde89980
public void setCount(Integer count) { this.count = count; }
28744c40-2f7b-4ee7-91a1-6cd46adb8efe
@Override public String toString() { return "ConnectionsCount [id=" + id + ", ip=" + ip + ", creationTime=" + creationTime + ", count=" + count + "]"; }
a60f7391-0cb6-448e-a7ce-bf36ad902cd6
@Deployment public static WebArchive createDeployment() { // jar pre server JavaArchive server = ShrinkWrap .create(JavaArchive.class, "server.jar") .addClasses(CounterBean.class, CounterEJB.class, ConnectionsCount.class, WSClient.class, MessageClient.class, CountMDB.class) .addPackage(AddCount.class.getPackage()); // vytvorenie war. return ShrinkWrap .create(WebArchive.class, "test.war") .addClasses(CountResource.class, ApplicationConfig.class) .addAsLibrary(server) .addAsResource("test-persistence.xml", "META-INF/persistence.xml") .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); }
44e1ae60-851b-4401-9ac9-8036f7082193
@Test public void testGetCustomerByIdUsingClientRequest() throws Exception { ClientRequest request = new ClientRequest(URL); request.accept("application/json"); String input = "{\"ip\":\"100.26.34.11\",\"count\":250}"; request.body("application/json", input); ClientResponse<String> response = request.post(String.class); int status = response.getStatus(); assertEquals(204, status); }
e69bb1d6-fddf-4809-8ad7-29623f4f02aa
public boolean test(T val);
09f2a0de-5e12-4e10-9780-d6c514768162
@Override public boolean test(Integer val) { return (val.intValue() % 2) != 0; } // test
d70827fd-f13e-4498-948d-c494de5c4f20
public DoublyLinkedList<UshahidiIncident> extract(UshahidiIncidentList ls) throws Exception { DoublyLinkedList<UshahidiIncident> list = new DoublyLinkedList<UshahidiIncident>(); DoublyLinkedListCursor<UshahidiIncident> curs = new DoublyLinkedListCursor(list.front); UshahidiIncident current; UshahidiLocation local; double lat = 0; /* average latitude of ls */ double lon = 0; /* average longitude of ls*/ double la = 0; /* current latitude */ double lo = 0; /* current longitude */ double distance = 100.0; int i = 0; // Move the UshahidiIncidents into the doubly-linked list and calculate // the average latitude and longitude while (ls.hasMoreIncidents()) { current = ls.nextIncident(); local = current.getLocation(); lat = lat + local.getLatitude(); lon = lon + local.getLongitude(); list.append(current); i += 1; } // Calculate the final averages lat = lat/i; lon = lon/i; // Set the boundaries for the distance to select UshahidiIncidents from double maxla = lat + distance; double minla = lat - distance; double maxlo = lon + distance; double minlo = lon - distance; // Delete UshahidiIncidents from list that are outside the distance // boundaries while (list.hasNext(curs)) { current = list.get(curs); local = current.getLocation(); la = local.getLatitude(); lo = local.getLongitude(); if ((la > maxla || la < minla) || (lo > maxlo || lo < minlo)) { list.delete(curs); } } return list; } // extract(UshahidiIncidentList)
99156253-de9f-4b0f-93fe-1e79b48e6010
public void summary(PrintWriter pen, UshahidiIncidentList ls) throws Exception { DoublyLinkedList<UshahidiIncident> list = new DoublyLinkedList<UshahidiIncident>(); DoublyLinkedListCursor<UshahidiIncident> curs = new DoublyLinkedListCursor(list.front); UshahidiIncident current; UshahidiLocation local; double lat = 0; /* average latitude of ls */ double lon = 0; /* average longitude of ls */ int i = 0; // Move the UshahidiIncidents into the doubly-linked list and calculate // the average latitude and longitude while (ls.hasMoreIncidents()) { current = ls.nextIncident(); local = current.getLocation(); lat = lat + local.getLatitude(); lon = lon + local.getLongitude(); list.append(current); i += 1; } // Print the useful information pen.println("Number of Incidents: " + i); pen.println("Incident Names:"); while(list.hasNext(curs)) { pen.println(list.get(curs).getTitle()); } curs.pos = list.front; /* reset the cursor to the front of the list */ pen.println("Incident Locations:"); while(list.hasNext(curs)) { pen.println(list.get(curs).getLocation().getName()); } pen.println("Average latitude of incidents: " + lat/i); pen.println("Average longitude of incidents: " + lon/i); } // summary(PrintWriter, UshahidiIncidentList)
b4074875-885d-4e98-8e01-fd3cb389dd27
public DoublyLinkedList() { this.front = null; this.back = null; } // DoublyLinkedList
b5c4bcd1-039c-4260-857f-f8b0e9fb4b9e
@Override public Iterator<T> iterator() { return new DoublyLinkedListIterator(this.front); } // iterator()
97d94c64-253e-4e20-945c-7ec48b5b033c
public void insert(T val, Cursor c) throws Exception { Node<T> in = new Node(val); DoublyLinkedListCursor<T> curs = (DoublyLinkedListCursor<T>) c; // Insert into null list if (this.front == null) { this.prepend(val); curs.pos = this.front; } else if (curs.pos == this.front) { // Insert at front this.prepend(val); curs.pos = this.front; } else { // Insert into middle in.prev = curs.pos.prev; curs.pos.prev.next = in; in.next = curs.pos; curs.pos.prev = in; curs.pos = in; } } // insert(T, Cursor)
2e9bf9ed-4043-4f8c-88bc-77b733e08a58
public void append(T val) throws Exception { if (this.back == null) { this.back = new Node(val); this.front = this.back; } else { this.back.next = new Node(val); this.back.next.prev = this.back; this.back = this.back.next; } } // append(T)
8a615d0b-884e-4dc3-a2fd-8b26394c2e8f
public void prepend(T val) throws Exception { Node<T> pre = new Node(val); pre.next = this.front; if (this.front != null) { front.prev = pre; } this.front = pre; if (this.back == null) { this.back = pre; } } // prepend(T)
f485091c-febc-4398-962c-1527bba6144a
public void delete(Cursor c) throws Exception { DoublyLinkedListCursor<T> curs = (DoublyLinkedListCursor<T>) c; if (curs.pos != this.front) { curs.pos.prev.next = curs.pos.next; } else { this.front = this.front.next; } if (curs.pos != this.back) { curs.pos.next.prev = curs.pos.prev; } else { this.back = this.back.prev; } curs.pos = curs.pos.next; } // delete(Cursor)
f69e19ca-20d1-4101-aa6f-70b6b7f0f80d
public Cursor front() throws Exception { return new DoublyLinkedListCursor<T>(this.front); } // front()
918934d8-ea78-4dfd-b648-83a9760ed4ff
public void advance(Cursor c) throws Exception { DoublyLinkedListCursor<T> curs = (DoublyLinkedListCursor<T>) c; if (curs.pos != null) { curs.pos = curs.pos.next; } } // advance(Cursor)
db18bb90-1d0c-4ef4-8e87-e3632fe1c264
public void retreat(Cursor c) throws Exception { DoublyLinkedListCursor<T> curs = (DoublyLinkedListCursor<T>) c; if (curs.pos != null) { curs.pos = curs.pos.prev; } } // retreat(Cursor)
e7391329-f07e-415e-9b91-8e7893da0566
public T get(Cursor c) throws Exception { DoublyLinkedListCursor<T> curs = (DoublyLinkedListCursor<T>) c; T value = curs.pos.val; return value; } // get(Cursor)
1ced7436-a3f6-468f-a529-460ac7b1f6c1
public T getPrev(Cursor c) throws Exception { DoublyLinkedListCursor<T> curs = (DoublyLinkedListCursor<T>) c; return curs.pos.prev.val; } // getPrev(Cursor)
f38ce8df-2f3d-435c-a8fd-8bfd334de2e4
public boolean hasNext(Cursor c) { DoublyLinkedListCursor<T> curs = (DoublyLinkedListCursor<T>) c; return curs.pos.next != null; } // hasNext(Cursor)
ec074ed9-3959-4c7b-87de-50353dc4b819
public boolean hasPrev(Cursor c) { DoublyLinkedListCursor<T> curs = (DoublyLinkedListCursor<T>) c; return curs.pos.prev != null; } // hasPrev(Cursor)
ddc2d26e-ee0a-40b6-96d1-b36390151acc
public void swap(Cursor c1, Cursor c2) throws Exception { DoublyLinkedListCursor<T> curs1 = (DoublyLinkedListCursor<T>) c1; DoublyLinkedListCursor<T> curs2 = (DoublyLinkedListCursor<T>) c2; Node<T> temp = curs1.pos; if (this.front == curs1.pos) { this.front = curs2.pos; } else if (this.front == curs2.pos) { this.front = curs1.pos; } else if (this.back == curs1.pos) { this.back = curs2.pos; } else if (this.back == curs2.pos) { this.back = curs1.pos; } if (curs1.pos.next == curs2.pos || curs2.pos.next == curs1.pos) { curs1.pos.prev = curs2.pos; curs1.pos.next = curs2.pos.next; curs2.pos.prev = temp.prev; curs2.pos.next = curs1.pos; curs1.pos.next.prev = curs1.pos; curs2.pos.prev.next = curs2.pos; } else { curs2.pos.prev.next = curs1.pos; curs2.pos.next.prev = curs1.pos; curs2.pos.prev = temp.prev; curs2.pos.next = temp.next; temp.prev.next = curs2.pos; temp.next.prev = curs2.pos; } } // swap(Cursor, Cursor)
b2e96069-fe53-4f0f-9993-1f8cd5741684
public boolean search(Cursor c, Predicate<T> pred) throws Exception { DoublyLinkedListCursor<T> curs = (DoublyLinkedListCursor<T>) c; Node<T> temp = curs.pos; curs.pos = this.front; while (this.hasNext(curs)) { if (pred.test(curs.pos.val)) { return true; } curs.pos = curs.pos.next; } curs.pos = temp; return false; } // search(Cursor, Predicate<T>)
f5f5b618-dfa3-4b58-a300-9b6f9b09a6c7
public ListOf<T> select(Predicate<T> pred) throws Exception { DoublyLinkedList<T> vals = new DoublyLinkedList<T>(); DoublyLinkedListCursor<T> curs = new DoublyLinkedListCursor<T>( this.front); while (this.hasNext(curs)) { if (pred.test(curs.pos.val)) { vals.append(curs.pos.val); } this.advance(curs); } return vals; } // select(Predicate<T>)
eb6f4789-9577-49cf-8192-269012873a78
public ListOf<T> subList(Cursor start, Cursor end) throws Exception { DoublyLinkedListCursor<T> curs1 = (DoublyLinkedListCursor<T>) start; DoublyLinkedListCursor<T> curs2 = (DoublyLinkedListCursor<T>) end; DoublyLinkedList<T> vals = new DoublyLinkedList<T>(); while (!curs1.equals(curs2)) { vals.append(curs1.pos.val); this.advance(curs1); } return vals; } // subList(Cursor, Cursor)
b80ece4d-bc6a-432f-acac-aca5f277b6b0
public boolean precedes(Cursor c1, Cursor c2) throws Exception { DoublyLinkedListCursor<T> curs1 = (DoublyLinkedListCursor<T>) c1; DoublyLinkedListCursor<T> curs2 = (DoublyLinkedListCursor<T>) c2; while (this.hasNext(curs1)) { if (curs1.equals(curs2)) { return true; } } return false; } // precedes(Cursor, Cursor)
c9219de4-75ac-48f2-b204-18d962ad3cde
public Node(T val) { this.val = val; this.next = null; this.prev = null; } // Node(T)
fc22666e-5600-49f2-b7fb-fc46bdeaf8f2
public DoublyLinkedListCursor(Node<T> pos) { this.pos = pos; } // DoublyLinkedListCursor
a80ab0d1-4ece-48e7-ae20-15a885fa3ca1
public DoublyLinkedListIterator(Node<T> pos) { this.pos = pos; } // DoublyLinkedListIterator(Node<T>)
eed4f045-f7a9-45d4-8d51-7cdbe98f081f
@Override public T next() { T temp = this.pos.next.val; this.pos = this.pos.next; return temp; } // next()
6d711bcf-d12c-4605-bf31-da5b1559406a
@Override public boolean hasNext() { return this.pos.next != null; } // hasNext()
70003f61-54cd-4c47-bc39-63c36bd30553
@Override public void remove() { // UNIMPLEMENTED throw new UnsupportedOperationException(); } // remove()
6166fd12-9f1a-4629-a6ac-239b34354ec1
@Override public boolean test(Integer val) { return val == 7; } // test
4f8cb4e4-513a-42de-a267-6ef6560720a4
public void insert(T val, Cursor c) throws Exception;
0781a204-3a63-444c-b2c7-730e048a7d0d
public void append(T val) throws Exception;
378b74ab-9c2b-47d9-83ae-8b1b669e4c4f
public void prepend(T val) throws Exception;
0475a022-580a-483e-87b1-fb13a58375a4
public void delete(Cursor c) throws Exception;
b34174d9-6a80-41b9-8c52-f0c2f697a516
@Override public Iterator<T> iterator();
0ea39afe-1add-406a-9b6d-2c541b2108b2
public Cursor front() throws Exception;
b4396f74-accb-41c3-95cf-12dbbb97c9db
public void advance(Cursor c) throws Exception;
f3246a37-3e0a-4f05-a6de-06050aca93a0
public void retreat(Cursor c) throws Exception;
0aecaea1-a4e8-4cc8-8e58-6f3171ad5352
public T get(Cursor c) throws Exception;
b91dced3-7dbf-4de4-bc49-8e0c8e015de9
public T getPrev(Cursor c) throws Exception;
0ea7b58d-a431-45c1-a3d5-241b511a3a1d
public boolean hasNext(Cursor c) throws Exception;