|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectbyucc.edif.NamedObject
public class NamedObject
A named String object with a valid EDIF name. These names are assumed to be valid EDIF 2.0 String names. This object is immutable.
This class has a number of helper functions for evaluating and manipulating Strings according to the EDIF specification. Edif Identifier Specification:
Identifier is a basic token type; it is used for name definition, name reference, keywords, and symbolic constants. It contains alphanumeric or underscore characters and must be preceded with an ampersand if the first character is not a letter. This will normally be recognized by a lexcial scanner.
Case is not significant in identifiers. There are no reserved identifiers, except within keywordNameDef. The length of an identifier must be between 1 and 256 characters, excluding the optional ampersand character. Identifiers are terminated by whiteSpace or by a left or right parenthesis.
Rename can be used to express external names which do not conform to the identifier syntax.
Example:
a12
&a12
A12
abc
&12s
&120
The first three identifiers in this example are identical. The last two must include the ampersand.
| Field Summary | |
|---|---|
protected java.lang.String |
_name
The String name of this object. |
| Constructor Summary | |
|---|---|
protected |
NamedObject()
|
|
NamedObject(EdifNameable n)
|
|
NamedObject(java.lang.String name)
Construct a NamedObject with the name string initalized. |
| Method Summary | |
|---|---|
java.lang.Object |
clone()
Perform a "deep" clone of the object. |
static EdifNameable |
createValidEdifNameable(java.lang.String string)
This method will create a new EdifNameable object from the given string. |
static java.lang.String |
createValidEdifString(java.lang.String string)
This method will check the string to see if it is a valid Edif string. |
boolean |
equals(java.lang.Object cmp)
Compare this Object's name to the given Object. |
java.lang.String |
getName()
Return the String name. |
java.lang.String |
getOldName()
|
static boolean |
isValidEdifName(java.lang.String string)
Test if the input string is a valid Edif name |
void |
toEdif(EdifPrintWriter epw)
Convert this object to EDIF format, and write the data to the passed-in EdifPrintWriter Object. |
java.lang.String |
toString()
Return the name of the object (same as the getName() method). |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String _name
| Constructor Detail |
|---|
protected NamedObject()
public NamedObject(java.lang.String name)
throws InvalidEdifNameException
name - String name of NamedObject.
InvalidEdifNameExceptionpublic NamedObject(EdifNameable n)
| Method Detail |
|---|
public java.lang.Object clone()
clone in class java.lang.Objectpublic static EdifNameable createValidEdifNameable(java.lang.String string)
string - The Name of this Object that will be used to
create a valid EDIF name if it isn't one already
EdifNameable Object that contains name
information about this NamedObject Objectpublic static java.lang.String createValidEdifString(java.lang.String string)
string - The String representation for a Name, which will
be used as a base to make the name valid, unless it already is
public boolean equals(java.lang.Object cmp)
equals in class java.lang.Objectcmp - The Object to compare to this one
public java.lang.String getName()
getName in interface Nameablepublic java.lang.String getOldName()
getOldName in interface EdifNameablepublic static boolean isValidEdifName(java.lang.String string)
string - the input string
public void toEdif(EdifPrintWriter epw)
toEdif in interface EdifOutepw - The EdifPrintWriter that the EDIF data will be
written topublic java.lang.String toString()
getName() method).
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||