|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecttcra.math.MathString<ElementType>
public class MathString<ElementType extends MathType>
MathString is an abstraction of the mathematical "String of [ElementType]". MathString is parameterized to allow the elements to be of any type of MathType.
| Constructor Summary | |
|---|---|
MathString(java.util.Vector<ElementType> elem,
MathStringParser msp)
Class constructor specifying the elements in the string and the MathStringParser used to parse the String from user input. |
|
| Method Summary | |
|---|---|
boolean |
compareElement(int index,
ElementType compare)
Checks the provided [ElementType] and the element of the string at 'index' for equality. |
MathString<ElementType> |
concat(ElementType latter)
Returns a MathString that has had the provided element concatenated on to it. |
MathString<ElementType> |
concat(MathString<ElementType> latter)
Returns a MathString that is the concatenation of this MathString and another MathString provided by the user. |
ElementType |
elementAt(int index)
Returns the element in the string at the specified index. |
boolean |
equals(java.lang.Object other)
Tests the MathString provided and this MathString for equality. |
boolean |
isSuffix(MathString<ElementType> suffix)
Checks to see if the provided MathString is contained at the end of this MathString. |
int |
length()
Returns the number of elements in the MathString |
MathString<ElementType> |
prepend(ElementType former)
Returns a MathString that has had the provided element concatenated on to the beginning of this string. |
MathString<ElementType> |
prepend(MathString<ElementType> former)
Returns a MathString that has had the provided MathString concatenated on to the beginning of this string. |
MathString<ElementType> |
reverse()
Get the reverse of this MathString |
java.util.Vector<MathString<ElementType>> |
split(int elemNum)
Returns two seperate MathStrings that this MathString split after the specified element number. |
java.lang.String |
toHTMLString()
In case the toString() function includes character that would not properly display in HTML, this string returns an HTML compliant version. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MathString(java.util.Vector<ElementType> elem,
MathStringParser msp)
elem - Vector of the parameterized type ElementType that
is the contents of the MathStringmsp - MathStringParser used to parse the user input| Method Detail |
|---|
public int length()
public MathString<ElementType> concat(MathString<ElementType> latter)
latter - MathString to be concatenated onto
this MathString.
public MathString<ElementType> concat(ElementType latter)
latter - Element to be added to this MathString
public MathString<ElementType> prepend(MathString<ElementType> former)
former - MathString to be added to this MathString
public MathString<ElementType> prepend(ElementType former)
former - Element to be added to this MathString
public boolean equals(java.lang.Object other)
equals in class java.lang.Objectother - MathString that this is compared to.
true if the MathString and the MathString
provided are equal.
false otherwise.
public boolean compareElement(int index,
ElementType compare)
index - Index of the element we want to compare the
provided [ElementType] to.compare - the [ElementType] to compare to
public java.util.Vector<MathString<ElementType>> split(int elemNum)
elemNum - position to split the MathString around.
public MathString<ElementType> reverse()
public boolean isSuffix(MathString<ElementType> suffix)
suffix - MathString to check for
true if suffix is present at the end
false otherwisepublic ElementType elementAt(int index)
index - 0-based index of element
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toHTMLString()
MathType< and
>.
toHTMLString in interface MathType
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||