edu.northwestern.at.wordhoard.model
Class Line

java.lang.Object
  extended by edu.northwestern.at.wordhoard.model.Line
All Implemented Interfaces:
PersistentObject

public class Line
extends java.lang.Object
implements PersistentObject

A line.

Each line has the following attributes:

As an example from Shakespeare, in "The First Part of King Henry the Fourth", Act 1, Scene 3, line 22F, the full tag is "sha-1h4103022F", the integer line number is 22, and the label is "22F".


Constructor Summary
Line()
          Creates a new line.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Returns true if some other object is equal to this one.
 void export(TableExporterImporter exporterImporter)
          Exports the object to a MySQL table exporter/importer.
 java.lang.Long getId()
          Gets the unique id.
 java.lang.String getLabel()
          Gets the label.
 TextRange getLocation()
          Gets the line location.
 int getNumber()
          Gets the line number.
 java.lang.String getStanzaLabel()
          Gets the stanza label.
 java.lang.String getTag()
          Gets the tag.
 WorkPart getWorkPart()
          Gets the work part.
 int hashCode()
          Returns a hash code for the object.
 void setId(java.lang.Long id)
          Sets the unique id.
 void setLabel(java.lang.String label)
          Sets the label.
 void setLocation(TextRange location)
          Sets the line location.
 void setNumber(int number)
          Sets the line number.
 void setStanzaLabel(java.lang.String stanzaLabel)
          Sets the stanza label.
 void setTag(java.lang.String tag)
          Sets the tag.
 void setWorkPart(WorkPart workPart)
          Sets the work part.
 java.lang.String toString()
          Gets a string representation of the line.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Line

public Line()
Creates a new line.

Method Detail

getId

public java.lang.Long getId()
Gets the unique id.

Specified by:
getId in interface PersistentObject
Returns:
The unique id.

setId

public void setId(java.lang.Long id)
Sets the unique id.

Parameters:
id - The unique id.

getTag

public java.lang.String getTag()
Gets the tag.

Returns:
The tag.

setTag

public void setTag(java.lang.String tag)
Sets the tag.

Parameters:
tag - The tag.

getNumber

public int getNumber()
Gets the line number.

Returns:
The line number.

setNumber

public void setNumber(int number)
Sets the line number.

Parameters:
number - The line number.

getLabel

public java.lang.String getLabel()
Gets the label.

Returns:
The label.

setLabel

public void setLabel(java.lang.String label)
Sets the label.

Parameters:
label - The label.

getStanzaLabel

public java.lang.String getStanzaLabel()
Gets the stanza label.

Returns:
The stanza label.

setStanzaLabel

public void setStanzaLabel(java.lang.String stanzaLabel)
Sets the stanza label.

Parameters:
stanzaLabel - The stanza label.

getWorkPart

public WorkPart getWorkPart()
Gets the work part.

Returns:
The work part.

setWorkPart

public void setWorkPart(WorkPart workPart)
Sets the work part.

Parameters:
workPart - The work part.

getLocation

public TextRange getLocation()
Gets the line location.

Returns:
The line location.

setLocation

public void setLocation(TextRange location)
Sets the line location.

Parameters:
location - The line location in the part text.

toString

public java.lang.String toString()
Gets a string representation of the line.

Overrides:
toString in class java.lang.Object
Returns:
The tag.

export

public void export(TableExporterImporter exporterImporter)
Exports the object to a MySQL table exporter/importer.

Parameters:
exporterImporter - MySQL table exporter/importer.

equals

public boolean equals(java.lang.Object obj)
Returns true if some other object is equal to this one.

The two lines are equal if their work parts and tags are equal.

Overrides:
equals in class java.lang.Object
Parameters:
obj - The other object.
Returns:
True if this object equals the other object.

hashCode

public int hashCode()
Returns a hash code for the object.

Overrides:
hashCode in class java.lang.Object
Returns:
The hash code.