Question: i need help writing a class from the information below Constructor Detail ConcordanceDataElement public ConcordanceDataElement (java.lang.String word) Constructor Parameters: word - the word for the

i need help writing a class from the information below

Constructor Detail

ConcordanceDataElement

public ConcordanceDataElement(java.lang.String word) 

Constructor

Parameters:

word - the word for the concordance data element

Method Detail

toString

public java.lang.String toString() 

Returns the word followed by page numbers Returns a string in the following format: word: page num, page num Example: after: 2,8,15

Overrides:

toString in class java.lang.Object

getWord

public java.lang.String getWord() 

Return the word portion of the Concordance Data Element

Returns:

the word portion of the Concordance Data Element

hashCode

public int hashCode() 

Returns the hashCode. You may use the String class hashCode method

Overrides:

hashCode in class java.lang.Object

getList

public java.util.LinkedList getList() 

Returns the linked list of integers that represent the line numbers

Returns:

the linked list of integers that represent the line numbers

addPage

public void addPage(int lineNum) 

Add a line number to the linked list if the number doesn't exist in the list

Parameters:

lineNum - the line number to add to the linked list

compareTo

public int compareTo(ConcordanceDataElement arg0) 

Specified by:

compareTo in interface java.lang.Comparable

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!