Question: i really need some help for this question. B. Project description Project 2 ADT LinkedString Java String class is composed of a collection of characters

i really need some help for this question.
i really need some help for this question. B. Project description Project
2 ADT LinkedString Java String class is composed of a collection of
characters and a set of operations on the characters. In this project,
you will create a reference based implementation on some String operations such
as chartAt concat, isEmpty, length, substring. A doubly linked list must be
used as the data structure. The class is called LinkedString. This class
must be implemented so that objects of LinkedString are immutable as String

B. Project description Project 2 ADT LinkedString Java String class is composed of a collection of characters and a set of operations on the characters. In this project, you will create a reference based implementation on some String operations such as chartAt concat, isEmpty, length, substring. A doubly linked list must be used as the data structure. The class is called LinkedString. This class must be implemented so that objects of LinkedString are immutable as String objects. In Java, a string is an immutable object (its internal states cannot be changed once it's created). Immutable means that once the constructor has completed execution that instance made can't be altered. This is useful as it means you can pass references to the object around, without worrying that someone else is going to change its contents. Any method that is invoked which seems to modify the value, will actually create another String. For example, three String objects, a, b, and ab, are created in the following code segment. String a = new String ("AA"); String b- new String (18"); String ab = a.concat(b): After String a new string("AA"); is executed, a new String object a is created. a "AA" After String b- new string("BB"), is executed, another new String object b is created, b "BB" After String ab = a.concat(h): is executed, another new String object ab is created. String althis string) and String b fa string passed into method concat) are not changed due to String immutability. Method concat simply copies the contents of a and b, and uses them to make a new String object. CICLO process. public class Driver public static void main(String[] args) Helper.start() 1 Notice that the driver and its helper class are for testing purpose only. They should not be included in the design dlagram. B. Project description Project 2 ADT LinkedString Java String class is composed of a collection of characters and a set of operations on the characters. In this project, you will create a reference-based implementation on some String operations such as chartat, concat, isEmpty, length, substring. A doubly linked list must be used as the data structure. The class is called LinkedString. This class must be implemented so that objects of LinkedString are immutable as String objects. In Java, a string is an immutable object (its internal states cannot be changed once it's created). Immutable means that once the constructor has completed execution that instance made can't be altered. This is useful as it means you can pass references to the object around, without worrying that someone else is going to change its contents. Any method that is invoked which seems to modify the value, will actually create another String. For example, three String objects, a, b, and ab, are created in the following code segment SETnew stre String String 2017 string ab.concat : After thing new. Az is executed a new String objecta is created. AAT. After SE SEES is executed, another new String objects is created After stanga scontos executed another new String object is created. String this strang) and, String = (a string passed into method canest) are not changed due to String immutability Method Simply copies the contents of and he and use them to make a new String object PAAR The UnkedString class must be implemented so that LinekdString objects are immutable. The LinkedString class must use a doubly linked list, a different data structure from the one used by the String class, to store a collection of characters. One character per node. This data structure is LinkedString 's Internal state. An immutable LinkedString object means its linked list can't be altered once the object is created. All characteristics and behaviors of EnkedString class must be designed with the same logic as lava String dass. When a LinkedString object calls a method, this LinkedString object and LinkedString object(s) passed into this method must be unchanged during execution of this method. If the method returns a LinkedString object, a new LinkedString object must be made. The following shows how object immutability can be enforced when implementing method concat. For example, three LinkedString objects, a, b, and ab, are created in the following code segment. Linkedsting anos linkedString (AT) Linkedstring Brow Linkedstrings Linkedstring aba.concat ibiz After Linkedsting a new Linkedstring"); is executed, a new LinkedString object is created with all characters stored in a doubly linked tist. Each node contains a Character element, a successor and a predecessor, od After Lakestrang Brien Linkedstring is executed, Snother new LinkedString object b is created with all characters stored in a doubly linked tist. Each node contains a Chorocter element, a successor and a predecessor. Alter bis executed another new inkedString object has created with all characters stored in a doubly linked list. Each node contains a Character element a successor and a predecessor EKOTEKET Methods must be implemented it wity which a newed string me without modifying this linked string and the other ned string to esforce objectionability. In order to do this meid Should simply copy characters and use them to make a new linked string nuti null B null LULL

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!