|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.quasiliteral.astro.AstroTag
Untamed:
Field Summary | |
private static StaticMaker |
AstroTagMaker
|
private Class |
myOptDataType
|
private short |
myOptTagCode
|
private String |
myTagName
|
(package private) static long |
serialVersionUID
|
Fields inherited from interface org.erights.e.elib.serial.Persistent |
HONORARY, HONORED_NAMES |
Fields inherited from interface org.erights.e.elib.serial.DeepPassByCopy |
HONORARY, HONORED_NAMES |
Constructor Summary | |
AstroTag(short optTagCode,
String tagName,
Class optDataType)
Enabled: |
Method Summary | |
double |
compareTo(AstroTag other)
Enabled: Compare on tag names regardless of schema or tag codes |
static StaticMaker |
getAstroTagMaker()
Enabled: |
Class |
getOptDataType()
Enabled: Indicates the type of data literally represented by this tag. |
short |
getOptTagCode()
Enabled: The enumerated tag code, or -1. |
Object[] |
getSpreadUncall()
Enabled: Uses 'AstroMaker(myOptTagCode, myTagName, myOptDataType)' |
String |
getTagName()
Enabled: The interned name of the enumerated tag code. |
boolean |
isTagForData(Object optData)
Enabled: Is this the tag implied by the type of optData? |
static Astro |
optAttribute(Astro root,
String rootName,
String attrName)
Enabled: Given that root is tagged with rootName, get its first argument that's tagged with attrName |
static Astro |
optFirstAttribute(Astro root,
String rootName,
String attrName)
Enabled: Like optAttribute/3, but only checks args[0]. |
static Object |
optPromoteData(Object optData)
Enabled: If optData is a data that's promotable to data that's representable literally, then return that literally representable; otherwise null. |
static Class |
optPromoteType(Class optDataType)
Enabled: If optDataType is a class of data that's promotable to one that's representable literally, then return the class that represents that literally-representable data type; otherwise null. |
static int |
tagCode2typeCode(short tagCode)
Enabled: The type-code for use by Antlr, which is the tag-code +1. |
String |
toString()
Suppressed: |
static short |
typeCode2tagCode(int typeCode)
Enabled: |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
static final long serialVersionUID
private static StaticMaker AstroTagMaker
private final short myOptTagCode
private final String myTagName
private final Class myOptDataType
Constructor Detail |
public AstroTag(short optTagCode, String tagName, Class optDataType)
optTagCode
- The enumerated tag code, or -1.tagName
- The name of the enumerated tag code.optDataType
- Either null, or the kind of data labeled by this
tag.Method Detail |
public static StaticMaker getAstroTagMaker()
public static int tagCode2typeCode(short tagCode)
If the tag-code is -1, the returned type code will be
Token#INVALID_TYPE
public static short typeCode2tagCode(int typeCode)
public static Class optPromoteType(Class optDataType)
optDataType
- null or the data type of some data we with to
promote to a literal representation.
Character
,public static Object optPromoteData(Object optData)
The obvious correctness criteria must hold between optPromoteData and optPromoteType. If p := optPromoteData(d), then
p.getClass() == optPromoteType(d.getClass())
optData
- null or some data we with to promote to a literal
representation.
Character
,public Object[] getSpreadUncall()
getSpreadUncall
in interface Selfless
public String toString()
toString
in class Object
public short getOptTagCode()
public String getTagName()
public Class getOptDataType()
If this tag is a normal symbolic tag, this is null. If it's a tag for a literal data type, this is the canonical class for that data type -- one of Character.class, BigInteger.class, Double.class, or Twine.class.
public boolean isTagForData(Object optData)
If optData is null, the answer is true.
public double compareTo(AstroTag other)
public static Astro optAttribute(Astro root, String rootName, String attrName)
public static Astro optFirstAttribute(Astro root, String rootName, String attrName)
If you know the arg you're looking for may only be first or absent, this is a nice little optimization. But it does make your format more position dependent, and therefore more brittle.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |