|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.ttools.taplint.AdhocCode
public class AdhocCode
ReportCode implementation which can be created at runtime.
In general, use of this class should be avoided in favour of
FixedCode
(create as many new enum constants as you want)
where possible, so that static determination of possible codes
works as well as it can.
Field Summary | |
---|---|
static int |
LABEL_LENGTH
Required length of labels. |
Constructor Summary | |
---|---|
AdhocCode(ReportType type,
String label)
Constructor. |
Method Summary | |
---|---|
static AdhocCode |
createCodeFromText(ReportType type,
String text)
Uses some hash function to generate a report code from text. |
static String |
createLabelChars(Object id,
int nchar)
Uses some hash function to generate a fixed-length character string from a supplied object. |
boolean |
equals(Object o)
|
String |
getLabel()
Returns the 4-character label of this code. |
ReportType |
getType()
Returns the type of this code. |
int |
hashCode()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int LABEL_LENGTH
Constructor Detail |
---|
public AdhocCode(ReportType type, String label)
type
- report typelabel
- 4-character labelMethod Detail |
---|
public ReportType getType()
ReportCode
getType
in interface ReportCode
public String getLabel()
ReportCode
getLabel
in interface ReportCode
public int hashCode()
hashCode
in class Object
public boolean equals(Object o)
equals
in class Object
public static AdhocCode createCodeFromText(ReportType type, String text)
type
- report typetext
- message text
public static String createLabelChars(Object id, int nchar)
id
- object to seed character generationnchar
- number of characters required
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |