|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.cinecolombia.common.utilcomponents.CodeDescription
Utility class allowing manipulation of pairs "code,description".
| Field Summary | |
private long |
code
A numeric code with a related description. |
private java.lang.String |
description
A readable description of the code. |
| Constructor Summary | |
CodeDescription()
Default constructor. |
|
CodeDescription(long cod,
java.lang.String d)
Constructor . |
|
| Method Summary | |
static CodeDescription |
assocCode(long cod,
CodeDescription[] cdArray)
Locates a CodigoDescription by its code in an
array of CodigoDescriptions. |
static CodeDescription |
assocDescription(java.lang.String descr,
CodeDescription[] cdArray)
Locates a CodigoDescription by its description
in an array of CodigoDescriptions. |
java.lang.Object |
clone()
Creates a clone of this. |
boolean |
equals(CodeDescription cd)
Standard equal comparison. |
long |
getCode()
Getter method for code. |
java.lang.String |
getDescription()
Getter method for description. |
static int |
getIndexCode(long code,
CodeDescription[] cd)
Gets the index of the first entry in a CodeDescription array having a specific "code" value. |
static int |
getIndexDescription(java.lang.String desc,
CodeDescription[] cd)
Gets the index of the first entry in a CodeDescription array having a specific "description" value. |
void |
setCode(long code)
Setter method for code. |
void |
setDescription(java.lang.String description)
Setter method for description. |
static long[] |
toCodes(CodeDescription[] cd)
Delivers an array with "codes" starting from an array of CodeDescriptions
. |
static java.lang.String[] |
toDescriptions(CodeDescription[] cd)
Delivers an array with "descriptions" starting from an array of CodeDescriptions
. |
static java.lang.String[] |
toDescriptionsWithUndef(CodeDescription[] cd,
java.lang.String undef)
Delivers an array with "descriptions" starting from an array of CodeDescriptions
. |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private long code
description.
private java.lang.String description
code.
| Constructor Detail |
public CodeDescription()
public CodeDescription(long cod,
java.lang.String d)
cod - The code value.d - The code description.| Method Detail |
public static CodeDescription assocCode(long cod,
CodeDescription[] cdArray)
CodigoDescription by its code in an
array of CodigoDescriptions.
cod - code used as search criteria.cdArray - Array where the CodigoDescription object is
looked for.
CodigoDescription inside arreglo
whose code matches cod, if it is found.
null Otherwise.
public static CodeDescription assocDescription(java.lang.String descr,
CodeDescription[] cdArray)
CodigoDescription by its description
in an array of CodigoDescriptions.
descr - description used as search criteria.cdArray - Array where the CodigoDescription object is
looked for.
CodigoDescription inside arreglo
whose description matches desrc, if it is
found. null Otherwise.public java.lang.Object clone()
this.
clone in class java.lang.Objectpublic boolean equals(CodeDescription cd)
cd - The comparison object. code. Descriptions are not
compared!!.
true If codes are equal. false Otherwise.public static java.lang.String[] toDescriptions(CodeDescription[] cd)
CodeDescriptions
.
cd - An array of CodeDescriptions.
public static java.lang.String[] toDescriptionsWithUndef(CodeDescription[] cd,
java.lang.String undef)
CodeDescriptions
. This array starts with a String corresponding to the "undefined" code.
cd - An array of CodeDescriptions.undef - A description for the "undefined" code.
public static long[] toCodes(CodeDescription[] cd)
CodeDescriptions
.
cd - An array of CodeDescriptions.
public void setCode(long code)
code.
code - The new code valuepublic void setDescription(java.lang.String description)
description.
description - The new description valuepublic long getCode()
code.
public java.lang.String getDescription()
description.
public static int getIndexCode(long code,
CodeDescription[] cd)
code - The code searched for.cd - The array where the code is searched.
public static int getIndexDescription(java.lang.String desc,
CodeDescription[] cd)
desc - The description searched for.cd - The array where the description is searched.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||