2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
8 package jalview.schemabinding.version2;
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
20 * @version $Revision$ $Date$
22 public class Setting implements java.io.Serializable
25 // --------------------------/
26 // - Class/Member Variables -/
27 // --------------------------/
32 private java.lang.String _type;
40 * keeps track of state for field: _colour
42 private boolean _has_colour;
47 private boolean _display;
50 * keeps track of state for field: _display
52 private boolean _has_display;
60 * keeps track of state for field: _order
62 private boolean _has_order;
65 * Optional minimum colour for graduated feature colour
68 private int _mincolour;
71 * keeps track of state for field: _mincolour
73 private boolean _has_mincolour;
76 * Field _noValueColour.
78 private jalview.schemabinding.version2.types.NoValueColour _noValueColour = jalview.schemabinding.version2.types.NoValueColour
82 * threshold value for graduated feature colour
85 private float _threshold;
88 * keeps track of state for field: _threshold
90 private boolean _has_threshold;
93 * threshold type for graduated feature colour
96 private int _threshstate;
99 * keeps track of state for field: _threshstate
101 private boolean _has_threshstate;
109 * keeps track of state for field: _max
111 private boolean _has_max;
119 * keeps track of state for field: _min
121 private boolean _has_min;
124 * Field _colourByLabel.
126 private boolean _colourByLabel;
129 * keeps track of state for field: _colourByLabel
131 private boolean _has_colourByLabel;
136 private boolean _autoScale;
139 * keeps track of state for field: _autoScale
141 private boolean _has_autoScale;
144 * name of feature attribute to colour by, or attribute and sub-attribute
146 private java.util.Vector _attributeNameList;
149 * optional filter(s) applied to the feature type
151 private jalview.schemabinding.version2.MatcherSet _matcherSet;
160 setNoValueColour(jalview.schemabinding.version2.types.NoValueColour
162 this._attributeNameList = new java.util.Vector();
172 * @param vAttributeName
173 * @throws java.lang.IndexOutOfBoundsException
174 * if the index given is outside the bounds of the collection
176 public void addAttributeName(final java.lang.String vAttributeName)
177 throws java.lang.IndexOutOfBoundsException
179 // check for the maximum size
180 if (this._attributeNameList.size() >= 2)
182 throw new IndexOutOfBoundsException(
183 "addAttributeName has a maximum of 2");
186 this._attributeNameList.addElement(vAttributeName);
193 * @param vAttributeName
194 * @throws java.lang.IndexOutOfBoundsException
195 * if the index given is outside the bounds of the collection
197 public void addAttributeName(final int index,
198 final java.lang.String vAttributeName)
199 throws java.lang.IndexOutOfBoundsException
201 // check for the maximum size
202 if (this._attributeNameList.size() >= 2)
204 throw new IndexOutOfBoundsException(
205 "addAttributeName has a maximum of 2");
208 this._attributeNameList.add(index, vAttributeName);
213 public void deleteAutoScale()
215 this._has_autoScale = false;
220 public void deleteColour()
222 this._has_colour = false;
227 public void deleteColourByLabel()
229 this._has_colourByLabel = false;
234 public void deleteDisplay()
236 this._has_display = false;
241 public void deleteMax()
243 this._has_max = false;
248 public void deleteMin()
250 this._has_min = false;
255 public void deleteMincolour()
257 this._has_mincolour = false;
262 public void deleteOrder()
264 this._has_order = false;
269 public void deleteThreshold()
271 this._has_threshold = false;
276 public void deleteThreshstate()
278 this._has_threshstate = false;
282 * Method enumerateAttributeName.
284 * @return an Enumeration over all java.lang.String elements
286 public java.util.Enumeration enumerateAttributeName()
288 return this._attributeNameList.elements();
292 * Method getAttributeName.
295 * @throws java.lang.IndexOutOfBoundsException
296 * if the index given is outside the bounds of the collection
297 * @return the value of the java.lang.String at the given index
299 public java.lang.String getAttributeName(final int index)
300 throws java.lang.IndexOutOfBoundsException
302 // check bounds for index
303 if (index < 0 || index >= this._attributeNameList.size())
305 throw new IndexOutOfBoundsException("getAttributeName: Index value '"
306 + index + "' not in range [0.."
307 + (this._attributeNameList.size() - 1) + "]");
310 return (java.lang.String) _attributeNameList.get(index);
314 * Method getAttributeName.Returns the contents of the collection in an Array.
316 * Note: Just in case the collection contents are changing in another thread,
317 * we pass a 0-length Array of the correct type into the API call. This way we
318 * <i>know</i> that the Array returned is of exactly the correct length.
320 * @return this collection as an Array
322 public java.lang.String[] getAttributeName()
324 java.lang.String[] array = new java.lang.String[0];
325 return (java.lang.String[]) this._attributeNameList.toArray(array);
329 * Method getAttributeNameCount.
331 * @return the size of this collection
333 public int getAttributeNameCount()
335 return this._attributeNameList.size();
339 * Returns the value of field 'autoScale'.
341 * @return the value of field 'AutoScale'.
343 public boolean getAutoScale()
345 return this._autoScale;
349 * Returns the value of field 'colour'.
351 * @return the value of field 'Colour'.
353 public int getColour()
359 * Returns the value of field 'colourByLabel'.
361 * @return the value of field 'ColourByLabel'.
363 public boolean getColourByLabel()
365 return this._colourByLabel;
369 * Returns the value of field 'display'.
371 * @return the value of field 'Display'.
373 public boolean getDisplay()
375 return this._display;
379 * Returns the value of field 'matcherSet'. The field 'matcherSet' has the
380 * following description: optional filter(s) applied to the feature type
382 * @return the value of field 'MatcherSet'.
384 public jalview.schemabinding.version2.MatcherSet getMatcherSet()
386 return this._matcherSet;
390 * Returns the value of field 'max'.
392 * @return the value of field 'Max'.
394 public float getMax()
400 * Returns the value of field 'min'.
402 * @return the value of field 'Min'.
404 public float getMin()
410 * Returns the value of field 'mincolour'. The field 'mincolour' has the
411 * following description: Optional minimum colour for graduated feature colour
414 * @return the value of field 'Mincolour'.
416 public int getMincolour()
418 return this._mincolour;
422 * Returns the value of field 'noValueColour'.
424 * @return the value of field 'NoValueColour'.
426 public jalview.schemabinding.version2.types.NoValueColour getNoValueColour()
428 return this._noValueColour;
432 * Returns the value of field 'order'.
434 * @return the value of field 'Order'.
436 public float getOrder()
442 * Returns the value of field 'threshold'. The field 'threshold' has the
443 * following description: threshold value for graduated feature colour
446 * @return the value of field 'Threshold'.
448 public float getThreshold()
450 return this._threshold;
454 * Returns the value of field 'threshstate'. The field 'threshstate' has the
455 * following description: threshold type for graduated feature colour
458 * @return the value of field 'Threshstate'.
460 public int getThreshstate()
462 return this._threshstate;
466 * Returns the value of field 'type'.
468 * @return the value of field 'Type'.
470 public java.lang.String getType()
476 * Method hasAutoScale.
478 * @return true if at least one AutoScale has been added
480 public boolean hasAutoScale()
482 return this._has_autoScale;
488 * @return true if at least one Colour has been added
490 public boolean hasColour()
492 return this._has_colour;
496 * Method hasColourByLabel.
498 * @return true if at least one ColourByLabel has been added
500 public boolean hasColourByLabel()
502 return this._has_colourByLabel;
508 * @return true if at least one Display has been added
510 public boolean hasDisplay()
512 return this._has_display;
518 * @return true if at least one Max has been added
520 public boolean hasMax()
522 return this._has_max;
528 * @return true if at least one Min has been added
530 public boolean hasMin()
532 return this._has_min;
536 * Method hasMincolour.
538 * @return true if at least one Mincolour has been added
540 public boolean hasMincolour()
542 return this._has_mincolour;
548 * @return true if at least one Order has been added
550 public boolean hasOrder()
552 return this._has_order;
556 * Method hasThreshold.
558 * @return true if at least one Threshold has been added
560 public boolean hasThreshold()
562 return this._has_threshold;
566 * Method hasThreshstate.
568 * @return true if at least one Threshstate has been added
570 public boolean hasThreshstate()
572 return this._has_threshstate;
576 * Returns the value of field 'autoScale'.
578 * @return the value of field 'AutoScale'.
580 public boolean isAutoScale()
582 return this._autoScale;
586 * Returns the value of field 'colourByLabel'.
588 * @return the value of field 'ColourByLabel'.
590 public boolean isColourByLabel()
592 return this._colourByLabel;
596 * Returns the value of field 'display'.
598 * @return the value of field 'Display'.
600 public boolean isDisplay()
602 return this._display;
608 * @return true if this object is valid according to the schema
610 public boolean isValid()
615 } catch (org.exolab.castor.xml.ValidationException vex)
626 * @throws org.exolab.castor.xml.MarshalException
627 * if object is null or if any SAXException is thrown during
629 * @throws org.exolab.castor.xml.ValidationException
630 * if this object is an invalid instance according to the schema
632 public void marshal(final java.io.Writer out)
633 throws org.exolab.castor.xml.MarshalException,
634 org.exolab.castor.xml.ValidationException
636 Marshaller.marshal(this, out);
643 * @throws java.io.IOException
644 * if an IOException occurs during marshaling
645 * @throws org.exolab.castor.xml.ValidationException
646 * if this object is an invalid instance according to the schema
647 * @throws org.exolab.castor.xml.MarshalException
648 * if object is null or if any SAXException is thrown during
651 public void marshal(final org.xml.sax.ContentHandler handler)
652 throws java.io.IOException,
653 org.exolab.castor.xml.MarshalException,
654 org.exolab.castor.xml.ValidationException
656 Marshaller.marshal(this, handler);
661 public void removeAllAttributeName()
663 this._attributeNameList.clear();
667 * Method removeAttributeName.
669 * @param vAttributeName
670 * @return true if the object was removed from the collection.
672 public boolean removeAttributeName(final java.lang.String vAttributeName)
674 boolean removed = _attributeNameList.remove(vAttributeName);
679 * Method removeAttributeNameAt.
682 * @return the element removed from the collection
684 public java.lang.String removeAttributeNameAt(final int index)
686 java.lang.Object obj = this._attributeNameList.remove(index);
687 return (java.lang.String) obj;
694 * @param vAttributeName
695 * @throws java.lang.IndexOutOfBoundsException
696 * if the index given is outside the bounds of the collection
698 public void setAttributeName(final int index,
699 final java.lang.String vAttributeName)
700 throws java.lang.IndexOutOfBoundsException
702 // check bounds for index
703 if (index < 0 || index >= this._attributeNameList.size())
705 throw new IndexOutOfBoundsException("setAttributeName: Index value '"
706 + index + "' not in range [0.."
707 + (this._attributeNameList.size() - 1) + "]");
710 this._attributeNameList.set(index, vAttributeName);
716 * @param vAttributeNameArray
718 public void setAttributeName(final java.lang.String[] vAttributeNameArray)
721 _attributeNameList.clear();
723 for (int i = 0; i < vAttributeNameArray.length; i++)
725 this._attributeNameList.add(vAttributeNameArray[i]);
730 * Sets the value of field 'autoScale'.
733 * the value of field 'autoScale'.
735 public void setAutoScale(final boolean autoScale)
737 this._autoScale = autoScale;
738 this._has_autoScale = true;
742 * Sets the value of field 'colour'.
745 * the value of field 'colour'.
747 public void setColour(final int colour)
749 this._colour = colour;
750 this._has_colour = true;
754 * Sets the value of field 'colourByLabel'.
756 * @param colourByLabel
757 * the value of field 'colourByLabel'.
759 public void setColourByLabel(final boolean colourByLabel)
761 this._colourByLabel = colourByLabel;
762 this._has_colourByLabel = true;
766 * Sets the value of field 'display'.
769 * the value of field 'display'.
771 public void setDisplay(final boolean display)
773 this._display = display;
774 this._has_display = true;
778 * Sets the value of field 'matcherSet'. The field 'matcherSet' has the
779 * following description: optional filter(s) applied to the feature type
782 * the value of field 'matcherSet'.
784 public void setMatcherSet(
785 final jalview.schemabinding.version2.MatcherSet matcherSet)
787 this._matcherSet = matcherSet;
791 * Sets the value of field 'max'.
794 * the value of field 'max'.
796 public void setMax(final float max)
799 this._has_max = true;
803 * Sets the value of field 'min'.
806 * the value of field 'min'.
808 public void setMin(final float min)
811 this._has_min = true;
815 * Sets the value of field 'mincolour'. The field 'mincolour' has the
816 * following description: Optional minimum colour for graduated feature colour
820 * the value of field 'mincolour'.
822 public void setMincolour(final int mincolour)
824 this._mincolour = mincolour;
825 this._has_mincolour = true;
829 * Sets the value of field 'noValueColour'.
831 * @param noValueColour
832 * the value of field 'noValueColour'.
834 public void setNoValueColour(
835 final jalview.schemabinding.version2.types.NoValueColour noValueColour)
837 this._noValueColour = noValueColour;
841 * Sets the value of field 'order'.
844 * the value of field 'order'.
846 public void setOrder(final float order)
849 this._has_order = true;
853 * Sets the value of field 'threshold'. The field 'threshold' has the
854 * following description: threshold value for graduated feature colour
858 * the value of field 'threshold'.
860 public void setThreshold(final float threshold)
862 this._threshold = threshold;
863 this._has_threshold = true;
867 * Sets the value of field 'threshstate'. The field 'threshstate' has the
868 * following description: threshold type for graduated feature colour
872 * the value of field 'threshstate'.
874 public void setThreshstate(final int threshstate)
876 this._threshstate = threshstate;
877 this._has_threshstate = true;
881 * Sets the value of field 'type'.
884 * the value of field 'type'.
886 public void setType(final java.lang.String type)
895 * @throws org.exolab.castor.xml.MarshalException
896 * if object is null or if any SAXException is thrown during
898 * @throws org.exolab.castor.xml.ValidationException
899 * if this object is an invalid instance according to the schema
900 * @return the unmarshaled jalview.schemabinding.version2.Settin
902 public static jalview.schemabinding.version2.Setting unmarshal(
903 final java.io.Reader reader)
904 throws org.exolab.castor.xml.MarshalException,
905 org.exolab.castor.xml.ValidationException
907 return (jalview.schemabinding.version2.Setting) Unmarshaller.unmarshal(
908 jalview.schemabinding.version2.Setting.class, reader);
914 * @throws org.exolab.castor.xml.ValidationException
915 * if this object is an invalid instance according to the schema
917 public void validate() throws org.exolab.castor.xml.ValidationException
919 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
920 validator.validate(this);