SlideShare a Scribd company logo
Please do parts labeled TODO
/**
* LinkedList.java
*
* Replace all //TODO tags with your code
*
* Note that below the "//TODO" tag there may be
* something like "return null;", "return 0;", etc.
* That line is just "stubbed in" so the class
* will compile. When you add your code (one or many
* statements), you will want to delete the "stubbed" line.
* By "stubbed in" we mean "mocked" or "faked in" temporarily.
*
* When testing, construct using the static factory methods:
LinkedList.newEmpty()
LinkedList.from(arrayElements)
*/
package model.list;
import java.lang.reflect.Array;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.BiFunction;
import java.util.function.Consumer;
import java.util.function.Function;
import model.linearpub.DynamicList;
import model.linearpub.StructureIterator;
//This class is NOT java.util.LinkedList
public class LinkedList implements DynamicList {
//---------------------------------
// Instance Variables
//TODO - declare instance variable(s)
//---------------------------------
// Private Constructor
/** Constructs and returns new LinkedList (no args constructor) */
private LinkedList() {
}
//-------------------- List Statistics ---------------------
/**
* Return number of elements in this list.
*/
@Override
public int size() {
//TODO
return 0;
}
/**
* Return true is this list contains no elements.
*/
@Override
public boolean isEmpty() {
//TODO
return false;
}
//------------------ Accessing Elements --------------------
/**
* Return element at given index.
* Throws IndexOutOfBoundsException if passed index is invalid.
*/
@Override
public E get(int index) {
//TODO
return null;
}
/**
* Return first element
* Throws RuntimeException if list is empty
*/
@Override
public E first() {
//TODO
return null;
}
/**
* Return last element
* Throws RuntimeException if list is empty
*/
@Override
public E last() {
//TODO
return null;
}
/**
* Return a new list containing the elements of this list
* between the given index "start" (inclusive) and
* the given index "stop" (exclusive).
* Throws IndexOutOfBoundsException if either passed index is invalid.
*/
@Override
public DynamicList subList(int start, int stop) {
//TODO
return null;
}
/**
* Return index of first matching element (where searchFct outputs true)
* Return -1 if no match
* Example usage (first list of integers, then employees):
* index = list.find(eaInteger -> eaInteger == 10);
* index = employeeList.find(employee -> employee .getFirstName().equals("Kofi"));
*/
@Override
public int findFirst(Function searchFct) {
//TODO
return 0;
}
/**
* Return index of last matching element (where searchFct outputs true)
* E.g., if searching for employee with name "Kofi" and there is a match
* at index=3 and index=8, findLast will return 8 (the last matching index).
* Hint: start search at end of list and work backwards through list.
* Return -1 if no match
*/
@Override
public int findLast(Function searchFct) {
//TODO
return 0;
}
//------------------- Setting Elements ---------------------
/**
* Insert passed arg "newElem" into position "index"
* Return previous (replaced) elem at "index"
* Valid "index" values are between 0 and "size - 1"
* If "index" is invalid, throws IndexOutOfBoundsException.
*/
@Override
public E set(int index, E newElem) {
//TODO
return null;
}
//------- Inserting, Appending & Replacing Elements --------
//------------------ (Dynamic Behaviors) ------------------
/**
* Add the passed element to start of list
*/
@Override
public void addFirst(E newElem) {
//TODO
}
/**
* Add the passed element to end of list
*/
@Override
public void addLast(E newElem) {
//TODO
}
/**
* Alias for "addLast" (same functionality)
*/
@Override
public void add(E newElem) {
//TODO
}
/**
* Add all elements from "otherDynList" into "this" list
*/
@Override
public void addAll(DynamicList otherDynList) {
//TODO
}
/**
* Add all elements from passed fixed array "this" list
*/
@Override
public void addAll(E[] array) {
//TODO
}
/**
* Shift to the right the element currently at "insertIndex" (if any) and all elements to the right
* Insert passed arg "newElem" into position "insertIndex"
* Valid "insertIndex" values are between 0 and "size"
* If index = "size" then it becomes a simple "add" operation
* If "insertIndex" is invalid, throws IndexOutOfBoundsException
*/
@Override
public void insert(int insertIndex, E newElem) {
//TODO
}
//------------------- Removing Elements --------------------
//------------------ (Dynamic Behaviors) ------------------
/**
* Remove first element
* Return removed element
* Throws RuntimeException if list is empty
*/
@Override
public E removeFirst() {
//TODO
return null;
}
/**
* Remove last element
* Return removed element
* Throws RuntimeException if list is empty
*/
@Override
public E removeLast() {
//TODO
return null;
}
/**
* Reset the list so it is empty.
* If list is already empty, then do nothing
* No action is performed on the elements.
*
*/
@Override
public void removeAll() {
//TODO
}
/**
* Remove elem at index
* Return the removed element
* Throws IndexOutOfBoundsException if passed index is invalid.
*/
@Override
public E removeIndex(int index) {
//TODO
return null;
}
/**
* Remove first matching element (where searchFct outputs true)
* Return the removed element
* If no match, return null
*/
@Override
public E removeFirstMatching(Function searchFct) {
//TODO
return null;
}
//----------------- Convenience Methods ------------------
/** Return this list as array
* This method requires imports of:
* java.lang.reflect.Array;
* java.util.concurrent.atomic.AtomicInteger;
*/
@Override
@SuppressWarnings("unchecked")
public E[] toArray() {
//This method is completed (no work needed)
if (this.isEmpty())
return (E[]) Array.newInstance(Object.class, 0);
StructureIterator iter = this.iterator();
E[] array = (E[]) Array.newInstance(iter.peek().getClass(), this.size());
AtomicInteger counter = new AtomicInteger(0);
this.forEach((each) -> array[counter.getAndIncrement()] = each);
return array;
}
/**
* Returns one-line user-friendly message about this object
* Helpful method especially for debugging.
*/
@Override
public String toString() {
//TODO
return null;
}
/** Prints all elements to console, with newline after each */
@Override
public void printAll() {
//TODO
}
/** Iterates over elements in "this" object. For each element,
* performs actionFct (passing element being iterated on)
* The generic type "? super E" means some type that is
* a superclass of E (inclusive)
*/
@Override
public void forEach(Consumer actionFct) {
//TODO
}
/** Return new list that is "this" list joined
* with "otherList" list (this list's elements are
* first followed by the "otherList" list)
*/
@Override
public DynamicList join(DynamicList otherList) {
//TODO
return null;
}
//----------------- Utility Methods ------------------
/**
* Returns new DynamicList with "new elements". Each new element
* is generated from mapFct invoked with an element from
* this list.
*/
@Override
public DynamicList map(Function mapFct) {
//TODO
return null;
}
/**
* Returns new DynamicList containing only elements that
* result in true when applied to selectFct
* Returns new DynamicList which is elements
* selected from this list via selectFct
*/
@Override
public DynamicList select(Function selectFct) {
//TODO
return null;
}
/**
* Returns new DynamicList which is this list
* with elements rejected via rejectFct
*/
@Override
public DynamicList reject(Function rejectFct) {
//TODO
return null;
}
/** Accumulate a value by iterating over the collection
* and accumulating during iteration.
* E.g., accumulate a "sum", or accumulate
* a new collection which is the accumulation
* of sub-collections obtained from elements (think
* of accumulating all players in a league by
* accumulating the players from each team
*/
@Override
public T accumulate(BiFunction fct, T initialValue) {
//TODO
return null;
}
//---------------------------------
// Public Constructors (Static Factory Constructor Methods)
// These two methods are completed for you
/** Return a new empty LinkedList */
public static DynamicList newEmpty() {
return new LinkedList<>();
}
/** Return a new LinkedList that contains all elements from the
* param "aFixedArray" */
public static DynamicList from(T[] aFixedArray) {
DynamicList list = LinkedList.newEmpty();
for (T nextNewElem: aFixedArray)
list.add(nextNewElem);
return list;
}
//----------------------------------------------------------
/*TODO - helper methods (optional -- coder's choice)
Helper method simply means any methods you
add (your choice) to make coding easier (i.e.,
methods that "help" other methods by doing some
of the work. The other methods call the "helper
methods".
*/
}

More Related Content

PDF
please read below it will tell you what we are using L.pdf
PDF
please read the steps below and it will tell you what we usi.pdf
PDF
we using java code DynamicArrayjava Replace all .pdf
PDF
we using java dynamicArray package modellinearpub imp.pdf
PDF
Note- Can someone help me with the public boolean isEmpty()- public bo.pdf
PDF
Given below is the completed implementation of MyLinkedList class. O.pdf
DOCX
Please complete all the code as per instructions in Java programming.docx
PDF
Hi,I have added the methods and main class as per your requirement.pdf
please read below it will tell you what we are using L.pdf
please read the steps below and it will tell you what we usi.pdf
we using java code DynamicArrayjava Replace all .pdf
we using java dynamicArray package modellinearpub imp.pdf
Note- Can someone help me with the public boolean isEmpty()- public bo.pdf
Given below is the completed implementation of MyLinkedList class. O.pdf
Please complete all the code as per instructions in Java programming.docx
Hi,I have added the methods and main class as per your requirement.pdf

Similar to Please do parts labeled TODO LinkedList.java Replace.pdf (20)

PDF
Note- Can someone help me with the Public boolean add(E value) method.pdf
PDF
STAGE 2 The Methods 65 points Implement all the methods t.pdf
DOCX
Note- Can someone help me with the private E get(int index- int curren (1).docx
PDF
Help please!!(Include your modified DList.java source code file in.pdf
PDF
Fix my codeCode.pdf
PDF
public class MyLinkedListltE extends ComparableltEgtg.pdf
PDF
Please help me to make a programming project I have to sue them today- (1).pdf
PDF
Implementation The starter code includes List.java. You should not c.pdf
PDF
File LinkedList.java Defines a doubly-l.pdf
PDF
import java.util.Iterator; import java.util.NoSuchElementException; .pdf
PDF
please i need help Im writing a program to test the merge sort alg.pdf
PDF
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
PDF
Class DiagramIn the Assignment #10, you are given three files Ass.pdf
DOCX
Collections framework
PDF
PLEASE MAKE SURE THE PROGRAM IS ASKING FOR INPUT FROM USER TO ADD OR.pdf
PPTX
Java collections
PDF
Here is the editable codeSolutionimport java.util.NoSuchEleme.pdf
PDF
import java-util--- public class MyLinkedList{ public static void.pdf
PDF
Everything needs to be according to the instructions- thank you! SUPPO.pdf
DOCX
JAVA Demonstrate the use of your APL in a PartB_Driver class by doing.docx
Note- Can someone help me with the Public boolean add(E value) method.pdf
STAGE 2 The Methods 65 points Implement all the methods t.pdf
Note- Can someone help me with the private E get(int index- int curren (1).docx
Help please!!(Include your modified DList.java source code file in.pdf
Fix my codeCode.pdf
public class MyLinkedListltE extends ComparableltEgtg.pdf
Please help me to make a programming project I have to sue them today- (1).pdf
Implementation The starter code includes List.java. You should not c.pdf
File LinkedList.java Defines a doubly-l.pdf
import java.util.Iterator; import java.util.NoSuchElementException; .pdf
please i need help Im writing a program to test the merge sort alg.pdf
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
Class DiagramIn the Assignment #10, you are given three files Ass.pdf
Collections framework
PLEASE MAKE SURE THE PROGRAM IS ASKING FOR INPUT FROM USER TO ADD OR.pdf
Java collections
Here is the editable codeSolutionimport java.util.NoSuchEleme.pdf
import java-util--- public class MyLinkedList{ public static void.pdf
Everything needs to be according to the instructions- thank you! SUPPO.pdf
JAVA Demonstrate the use of your APL in a PartB_Driver class by doing.docx

More from aioils (20)

PDF
Please help solve! Suppose that X is an exponential random variable .pdf
PDF
Please help me with a UML class diagram for the following code im.pdf
PDF
Please help me i will give good rating a) A wheel has 37 numbers 0.pdf
PDF
Please help me answer this question.Explain how oxygen content acc.pdf
PDF
PLEASE HELP IN C++For this test, you will need to create the follo.pdf
PDF
please help and thank you ! Experiments by Murphy et al. (2014) on t.pdf
PDF
PLEASE HELP (also please dont answer with path because there is no .pdf
PDF
please explain these topics if possible How companies account for.pdf
PDF
Pls introduced to various themes and theoretical issues pertaining t.pdf
PDF
please! 1. Match and pair the following basic genetic conce.pdf
PDF
Please write out steps )You have genotyped an entire population o.pdf
PDF
Please write out the steps )_You have genotyped an entire populat.pdf
PDF
Please Use The Code Provided below. Thanks Study the Python code .pdf
PDF
Please Use the Code Provided below. Thanks Visit LL Queue ; add.pdf
PDF
Please this is very important Im on a deadline The joint probabilit.pdf
PDF
Please solve. In the Assembly Department of Martinez Company, budget.pdf
PDF
Please do Part A, Ill be really gratefulThe main.c is the skeleto.pdf
PDF
Please do number 1 as its my choice for this project but, if there.pdf
PDF
Please show workstepsYou have genotyped an entire population of l.pdf
PDF
Please show all steps of algebra. I have the answer shown below but .pdf
Please help solve! Suppose that X is an exponential random variable .pdf
Please help me with a UML class diagram for the following code im.pdf
Please help me i will give good rating a) A wheel has 37 numbers 0.pdf
Please help me answer this question.Explain how oxygen content acc.pdf
PLEASE HELP IN C++For this test, you will need to create the follo.pdf
please help and thank you ! Experiments by Murphy et al. (2014) on t.pdf
PLEASE HELP (also please dont answer with path because there is no .pdf
please explain these topics if possible How companies account for.pdf
Pls introduced to various themes and theoretical issues pertaining t.pdf
please! 1. Match and pair the following basic genetic conce.pdf
Please write out steps )You have genotyped an entire population o.pdf
Please write out the steps )_You have genotyped an entire populat.pdf
Please Use The Code Provided below. Thanks Study the Python code .pdf
Please Use the Code Provided below. Thanks Visit LL Queue ; add.pdf
Please this is very important Im on a deadline The joint probabilit.pdf
Please solve. In the Assembly Department of Martinez Company, budget.pdf
Please do Part A, Ill be really gratefulThe main.c is the skeleto.pdf
Please do number 1 as its my choice for this project but, if there.pdf
Please show workstepsYou have genotyped an entire population of l.pdf
Please show all steps of algebra. I have the answer shown below but .pdf

Recently uploaded (20)

PDF
Complications of Minimal Access Surgery at WLH
PDF
01-Introduction-to-Information-Management.pdf
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
Computing-Curriculum for Schools in Ghana
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
Cell Structure & Organelles in detailed.
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
Cell Types and Its function , kingdom of life
Complications of Minimal Access Surgery at WLH
01-Introduction-to-Information-Management.pdf
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Computing-Curriculum for Schools in Ghana
202450812 BayCHI UCSC-SV 20250812 v17.pptx
Pharmacology of Heart Failure /Pharmacotherapy of CHF
human mycosis Human fungal infections are called human mycosis..pptx
Cell Structure & Organelles in detailed.
2.FourierTransform-ShortQuestionswithAnswers.pdf
Final Presentation General Medicine 03-08-2024.pptx
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
FourierSeries-QuestionsWithAnswers(Part-A).pdf
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
Cell Types and Its function , kingdom of life

Please do parts labeled TODO LinkedList.java Replace.pdf

  • 1. Please do parts labeled TODO /** * LinkedList.java * * Replace all //TODO tags with your code * * Note that below the "//TODO" tag there may be * something like "return null;", "return 0;", etc. * That line is just "stubbed in" so the class * will compile. When you add your code (one or many * statements), you will want to delete the "stubbed" line. * By "stubbed in" we mean "mocked" or "faked in" temporarily. * * When testing, construct using the static factory methods: LinkedList.newEmpty() LinkedList.from(arrayElements) */ package model.list; import java.lang.reflect.Array; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.BiFunction; import java.util.function.Consumer; import java.util.function.Function; import model.linearpub.DynamicList; import model.linearpub.StructureIterator; //This class is NOT java.util.LinkedList public class LinkedList implements DynamicList {
  • 2. //--------------------------------- // Instance Variables //TODO - declare instance variable(s) //--------------------------------- // Private Constructor /** Constructs and returns new LinkedList (no args constructor) */ private LinkedList() { } //-------------------- List Statistics --------------------- /** * Return number of elements in this list. */ @Override public int size() { //TODO return 0; } /** * Return true is this list contains no elements. */ @Override public boolean isEmpty() { //TODO return false; } //------------------ Accessing Elements -------------------- /** * Return element at given index.
  • 3. * Throws IndexOutOfBoundsException if passed index is invalid. */ @Override public E get(int index) { //TODO return null; } /** * Return first element * Throws RuntimeException if list is empty */ @Override public E first() { //TODO return null; } /** * Return last element * Throws RuntimeException if list is empty */ @Override public E last() { //TODO return null; } /** * Return a new list containing the elements of this list * between the given index "start" (inclusive) and * the given index "stop" (exclusive). * Throws IndexOutOfBoundsException if either passed index is invalid. */ @Override public DynamicList subList(int start, int stop) {
  • 4. //TODO return null; } /** * Return index of first matching element (where searchFct outputs true) * Return -1 if no match * Example usage (first list of integers, then employees): * index = list.find(eaInteger -> eaInteger == 10); * index = employeeList.find(employee -> employee .getFirstName().equals("Kofi")); */ @Override public int findFirst(Function searchFct) { //TODO return 0; } /** * Return index of last matching element (where searchFct outputs true) * E.g., if searching for employee with name "Kofi" and there is a match * at index=3 and index=8, findLast will return 8 (the last matching index). * Hint: start search at end of list and work backwards through list. * Return -1 if no match */ @Override public int findLast(Function searchFct) { //TODO return 0; } //------------------- Setting Elements --------------------- /** * Insert passed arg "newElem" into position "index" * Return previous (replaced) elem at "index" * Valid "index" values are between 0 and "size - 1"
  • 5. * If "index" is invalid, throws IndexOutOfBoundsException. */ @Override public E set(int index, E newElem) { //TODO return null; } //------- Inserting, Appending & Replacing Elements -------- //------------------ (Dynamic Behaviors) ------------------ /** * Add the passed element to start of list */ @Override public void addFirst(E newElem) { //TODO } /** * Add the passed element to end of list */ @Override public void addLast(E newElem) { //TODO } /** * Alias for "addLast" (same functionality) */ @Override public void add(E newElem) { //TODO } /**
  • 6. * Add all elements from "otherDynList" into "this" list */ @Override public void addAll(DynamicList otherDynList) { //TODO } /** * Add all elements from passed fixed array "this" list */ @Override public void addAll(E[] array) { //TODO } /** * Shift to the right the element currently at "insertIndex" (if any) and all elements to the right * Insert passed arg "newElem" into position "insertIndex" * Valid "insertIndex" values are between 0 and "size" * If index = "size" then it becomes a simple "add" operation * If "insertIndex" is invalid, throws IndexOutOfBoundsException */ @Override public void insert(int insertIndex, E newElem) { //TODO } //------------------- Removing Elements -------------------- //------------------ (Dynamic Behaviors) ------------------ /** * Remove first element * Return removed element * Throws RuntimeException if list is empty */ @Override
  • 7. public E removeFirst() { //TODO return null; } /** * Remove last element * Return removed element * Throws RuntimeException if list is empty */ @Override public E removeLast() { //TODO return null; } /** * Reset the list so it is empty. * If list is already empty, then do nothing * No action is performed on the elements. * */ @Override public void removeAll() { //TODO } /** * Remove elem at index * Return the removed element * Throws IndexOutOfBoundsException if passed index is invalid. */ @Override public E removeIndex(int index) { //TODO return null;
  • 8. } /** * Remove first matching element (where searchFct outputs true) * Return the removed element * If no match, return null */ @Override public E removeFirstMatching(Function searchFct) { //TODO return null; } //----------------- Convenience Methods ------------------ /** Return this list as array * This method requires imports of: * java.lang.reflect.Array; * java.util.concurrent.atomic.AtomicInteger; */ @Override @SuppressWarnings("unchecked") public E[] toArray() { //This method is completed (no work needed) if (this.isEmpty()) return (E[]) Array.newInstance(Object.class, 0); StructureIterator iter = this.iterator(); E[] array = (E[]) Array.newInstance(iter.peek().getClass(), this.size()); AtomicInteger counter = new AtomicInteger(0); this.forEach((each) -> array[counter.getAndIncrement()] = each); return array; } /** * Returns one-line user-friendly message about this object * Helpful method especially for debugging.
  • 9. */ @Override public String toString() { //TODO return null; } /** Prints all elements to console, with newline after each */ @Override public void printAll() { //TODO } /** Iterates over elements in "this" object. For each element, * performs actionFct (passing element being iterated on) * The generic type "? super E" means some type that is * a superclass of E (inclusive) */ @Override public void forEach(Consumer actionFct) { //TODO } /** Return new list that is "this" list joined * with "otherList" list (this list's elements are * first followed by the "otherList" list) */ @Override public DynamicList join(DynamicList otherList) { //TODO return null; } //----------------- Utility Methods ------------------ /**
  • 10. * Returns new DynamicList with "new elements". Each new element * is generated from mapFct invoked with an element from * this list. */ @Override public DynamicList map(Function mapFct) { //TODO return null; } /** * Returns new DynamicList containing only elements that * result in true when applied to selectFct * Returns new DynamicList which is elements * selected from this list via selectFct */ @Override public DynamicList select(Function selectFct) { //TODO return null; } /** * Returns new DynamicList which is this list * with elements rejected via rejectFct */ @Override public DynamicList reject(Function rejectFct) { //TODO return null; } /** Accumulate a value by iterating over the collection * and accumulating during iteration. * E.g., accumulate a "sum", or accumulate * a new collection which is the accumulation
  • 11. * of sub-collections obtained from elements (think * of accumulating all players in a league by * accumulating the players from each team */ @Override public T accumulate(BiFunction fct, T initialValue) { //TODO return null; } //--------------------------------- // Public Constructors (Static Factory Constructor Methods) // These two methods are completed for you /** Return a new empty LinkedList */ public static DynamicList newEmpty() { return new LinkedList<>(); } /** Return a new LinkedList that contains all elements from the * param "aFixedArray" */ public static DynamicList from(T[] aFixedArray) { DynamicList list = LinkedList.newEmpty(); for (T nextNewElem: aFixedArray) list.add(nextNewElem); return list; } //---------------------------------------------------------- /*TODO - helper methods (optional -- coder's choice) Helper method simply means any methods you add (your choice) to make coding easier (i.e., methods that "help" other methods by doing some of the work. The other methods call the "helper methods".
  • 12. */ }