|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.bsd.x2svg.Cardinality
public class Cardinality
Cardinalities for elements. This is expressed as [from,to] with from being the lower bound and to the upper. If 'from' is 0, the Cardinality is optional. If the flag 'empty' is set, then the Cardinality is optional, but from is marked as the empty string. This is done to allow for rendering of elements like a non-optional element, while still having a an empty 'from value.
Nested Class Summary | |
---|---|
static class |
Cardinality.DTDValues
Cardinalities as found in DTDs |
Field Summary | |
---|---|
private boolean |
empty
|
private java.lang.String |
from
lower value |
private java.lang.String |
to
upper value |
Constructor Summary | |
---|---|
Cardinality(boolean empty)
Construct a Cardinality object where to and from are empty. |
|
Cardinality(Cardinality.DTDValues dtdValue)
Construct a Cardinality object by means of values from a DTD |
|
Cardinality(int from,
int to)
Construct a Cardinality object with explicitly given from and to Note: infinite must be given as Integer.MAX_VALUE |
|
Cardinality(java.lang.String from,
java.lang.String to)
Construct a Cardinality object with explicitly given from and to as String |
Method Summary | |
---|---|
java.lang.String |
getFrom()
|
java.lang.String |
getTo()
|
boolean |
isOptional()
Is this element optional (from is 0 or empty or null) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.lang.String from
private java.lang.String to
private boolean empty
Constructor Detail |
---|
public Cardinality(boolean empty)
empty
- true if no cardinality should be used.public Cardinality(java.lang.String from, java.lang.String to)
from
- the lower value of the cardinality pairto
- upper value of cardinality pair. Infinite should be given as Asterisk ('*')public Cardinality(int from, int to)
from
- the lower value of the cardinality pairto
- upper value of cardinality pair. Unbounded is expressed as -1public Cardinality(Cardinality.DTDValues dtdValue)
dtdValue
- Cardinalities as found in DTDsMethod Detail |
---|
public boolean isOptional()
public java.lang.String getFrom()
public java.lang.String getTo()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |