51 |
* following way: |
* following way: |
52 |
* <pre> |
* <pre> |
53 |
* a = new ContentModel('+', A, null); // a reprensents A+ |
* a = new ContentModel('+', A, null); // a reprensents A+ |
54 |
* b = new ContentModel('&', B, a); // b represents B & A+ |
* b = new ContentModel('&', B, a); // b represents B & A+ |
55 |
* c = new ContentModel('*', b, null); // c represents ( B & A+) * |
* c = new ContentModel('*', b, null); // c represents ( B & A+) * |
56 |
* d = new ContentModel('|', new ContentModel('*', A, null), |
* d = new ContentModel('|', new ContentModel('*', A, null), |
57 |
* new ContentModel('?', B, null)); // d represents ( A* | B? ) |
* new ContentModel('?', B, null)); // d represents ( A* | B? ) |
58 |
* </pre> |
* </pre> |
65 |
* <li><code>A|B</code> both A and B are permitted in any order. |
* <li><code>A|B</code> both A and B are permitted in any order. |
66 |
* The '|' alone does not permit the repetetive occurence of A or B |
* The '|' alone does not permit the repetetive occurence of A or B |
67 |
* (use <code>(A|B)*</code>.</li> |
* (use <code>(A|B)*</code>.</li> |
68 |
* <li><code>A&B both A and B must occur once (in any order)</li> |
* <li><code>A&B</code> both A and B must occur once (in any order)</li> |
69 |
* </ul> |
* </ul> |
70 |
* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) |
* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) |
71 |
*/ |
*/ |
73 |
implements Serializable |
implements Serializable |
74 |
{ |
{ |
75 |
/** Use serialVersionUID for interoperability. */ |
/** Use serialVersionUID for interoperability. */ |
76 |
private final static long serialVersionUID = -1130825523866321257L; |
private static final long serialVersionUID = -1130825523866321257L; |
77 |
|
|
78 |
/** |
/** |
79 |
* The next content model model ( = pointer to the next element of |
* The next content model model ( = pointer to the next element of |
80 |
* the linked list) for the binary expression (',','&' or '|'). Null |
* the linked list) for the binary expression (',','&' or '|'). Null |
81 |
* for the last element in the list. |
* for the last element in the list. |
82 |
*/ |
*/ |
83 |
public ContentModel next; |
public ContentModel next; |
105 |
* Examples: |
* Examples: |
106 |
*<code> |
*<code> |
107 |
* a = new ContentModel('+', A, null); // a reprensents A+ |
* a = new ContentModel('+', A, null); // a reprensents A+ |
108 |
* b = new ContentModel('&', B, a); // b represents B & A+ |
* b = new ContentModel('&', B, a); // b represents B & A+ |
109 |
* c = new ContentModel('*', b, null); // c represents ( B & A+) * |
* c = new ContentModel('*', b, null); // c represents ( B & A+) * |
110 |
* d = new ContentModel('|', A, |
* d = new ContentModel('|', A, |
111 |
* new ContentModel('?',b, null); |
* new ContentModel('?',b, null); |
112 |
* // d represents |
* // d represents |
130 |
|
|
131 |
/** |
/** |
132 |
* Create a content model, involving binary expression of the given type. |
* Create a content model, involving binary expression of the given type. |
133 |
* @param a_type The expression operation type ( ',', '|' or '&'). |
* @param a_type The expression operation type ( ',', '|' or '&'). |
134 |
* @param a_content The content of the left part of the expression. |
* @param a_content The content of the left part of the expression. |
135 |
* @param a_next The content model, representing the right part of the |
* @param a_next The content model, representing the right part of the |
136 |
* expression. |
* expression. |