axis_examplecompt_changesinfo-opsversion-1.30version-2.00version-3.01version-3.02
Last change
on this file since 866c983 was
8780cbec,
checked in by Jay Jacobs <Jay.Jacobs@…>, 15 years ago
|
ABAC sources from Cobham
|
-
Property mode set to
100644
|
File size:
1.5 KB
|
Rev | Line | |
---|
[8780cbec] | 1 | package edu.stanford.rt.datatype; |
---|
| 2 | |
---|
| 3 | import java.util.*; |
---|
| 4 | |
---|
| 5 | /** |
---|
| 6 | * @author Ninghui Li, Sandra Qiu <br> |
---|
| 7 | * |
---|
| 8 | * Implementation of <code>TreeType</code> element |
---|
| 9 | * |
---|
| 10 | */ |
---|
| 11 | public class TreeType extends SimpleType |
---|
| 12 | { |
---|
| 13 | /** separator of the tree type. */ |
---|
| 14 | private String separator; // required attr. |
---|
| 15 | /** ordering of the tree type */ |
---|
| 16 | private boolean rootFirst; |
---|
| 17 | |
---|
| 18 | /** |
---|
| 19 | * Constructor for TreeType |
---|
| 20 | */ |
---|
| 21 | public TreeType(String name, String separator, boolean rootFirst) |
---|
| 22 | { |
---|
| 23 | super(name); |
---|
| 24 | this.separator = separator; |
---|
| 25 | rootFirst = rootFirst; |
---|
| 26 | } |
---|
| 27 | |
---|
| 28 | /** |
---|
| 29 | * Method isRootFirst. |
---|
| 30 | * @return boolean |
---|
| 31 | */ |
---|
| 32 | public boolean isRootFirst() |
---|
| 33 | { |
---|
| 34 | return rootFirst; |
---|
| 35 | } |
---|
| 36 | |
---|
| 37 | /** |
---|
| 38 | * Method getSeparator. |
---|
| 39 | * @return String |
---|
| 40 | */ |
---|
| 41 | public String getSeparator() |
---|
| 42 | { |
---|
| 43 | return separator; |
---|
| 44 | } |
---|
| 45 | |
---|
| 46 | /* (non-Javadoc) |
---|
| 47 | * @see edu.stanford.rt.datatype.SimpleType#isValidValue(DataValue) |
---|
| 48 | */ |
---|
| 49 | public boolean isValidValue(DataValue v) |
---|
| 50 | { |
---|
| 51 | if (!(v instanceof TreeValue)) |
---|
| 52 | return false; |
---|
| 53 | return true; |
---|
| 54 | } |
---|
| 55 | |
---|
| 56 | /* (non-Javadoc) |
---|
| 57 | * @see edu.stanford.rt.datatype.DataType#toString(String) |
---|
| 58 | */ |
---|
| 59 | public String toString(String indent) |
---|
| 60 | { |
---|
| 61 | String thisIndent = indent + " "; |
---|
| 62 | StringBuffer sb = new StringBuffer(); |
---|
| 63 | sb |
---|
| 64 | .append(thisIndent) |
---|
| 65 | .append("TreeType: ") |
---|
| 66 | .append(getName()) |
---|
| 67 | .append(" ") |
---|
| 68 | .append("separator=") |
---|
| 69 | .append(separator) |
---|
| 70 | .append(" ") |
---|
| 71 | .append("order=") |
---|
| 72 | .append(rootFirst ? "rootFirst" : "leafFirst") |
---|
| 73 | .append("\n"); |
---|
| 74 | |
---|
| 75 | return sb.toString(); |
---|
| 76 | |
---|
| 77 | } |
---|
| 78 | |
---|
| 79 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.