org.inria.ns.reflex.xml.operator
Class ArrayOperator

java.lang.Object
  extended by org.inria.ns.reflex.xml.operator.AbstractXOperator
      extended by org.inria.ns.reflex.xml.operator.ArrayOperator
All Implemented Interfaces:
LoopOnChildren, XOperator

public class ArrayOperator
extends AbstractXOperator
implements LoopOnChildren

XML operations on an array.

Author:
Philippe Poulard

Method Summary
 boolean booleanValueOf(Object referent)
          This implementation returns the boolean value of the referent based on its string value.
 Map getAttributes(Object referent)
          Returns the attributes of the given referent object.
 List getChildren(Object referent)
          Returns the children of the given referent object.
 int getFamilyIndex(Object referent)
          Return the intrinsic position of this item amongs items of the same family, that is to say 0.
 int getFamilySize(Object referent)
          Return the intrinsic size of this item amongs items of the same family, that is to say 0.
 int getIndex(Object referent)
          Return the intrinsic position of an object, that is to say 0.
 int getNameIndex(Object referent)
          Return the intrinsic position of this item amongs items of the same name, that is to say 0.
 int getNameSize(Object referent)
          Return the intrinsic position of this item amongs items of the same name, that is to say 0.
 short getNodeType(Object referent)
          The referent behaves like an element.
 int getSize(Object referent)
          Return the intrinsic size of an object, that is to say 0.
 int getTypeIndex(Object referent)
          Return the intrinsic position of this item amongs items of the same type, that is to say 0.
 QName getTypeName(Object referent)
          Return #adt:list.
 int getTypeSize(Object referent)
          Return the intrinsic size of this item amongs items of the same type, that is to say 0.
 Number numberValueOf(Object referent)
          This implementation returns the number value of the referent based on its string value.
 String stringValueOf(Object referent)
          This implementation returns the string value of the referent.
 Object valueOf(Object referent)
          Return the first item in the array or null.
 
Methods inherited from class org.inria.ns.reflex.xml.operator.AbstractXOperator
append, append, clear, clear, clearAll, clearAll, clone, clone, getAttributeValue, getCommentAt, getElementAt, getElementById, getElementsByName, getNamedElementAt, getNamedProcessingInstructionAt, getNamespaces, getNext, getNodeAt, getNodeKind, getParent, getPrevious, getProcessingInstructionAt, getQName, getRoot, getStringAttributeValue, getStringName, getTextAt, getType, getValue, getXFactory, getXMLType, getXOperator, insertAfter, insertAfter, insertBefore, insertBefore, isAttribute, isComment, isDocument, isElement, isParentNode, isProcessingInstruction, isText, remove, remove, removeAttribute, rename, rename, replace, replace, setAttribute, update, update
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getChildren

public List getChildren(Object referent)
Description copied from interface: XOperator
Returns the children of the given referent object.

Specified by:
getChildren in interface XOperator
Parameters:
referent - The referent object.
Returns:
The childs of the referent object.
See Also:
XOperator.getChildren(java.lang.Object)

getAttributes

public Map getAttributes(Object referent)
Description copied from interface: XOperator
Returns the attributes of the given referent object.

Specified by:
getAttributes in interface XOperator
Parameters:
referent - The referent object.
Returns:
The attributes of the referent object.
See Also:
XOperator.getAttributes(java.lang.Object)

stringValueOf

public String stringValueOf(Object referent)
Description copied from class: AbstractXOperator
This implementation returns the string value of the referent.

Specified by:
stringValueOf in interface XOperator
Overrides:
stringValueOf in class AbstractXOperator
Parameters:
referent - The referent.
Returns:
Its string value.
See Also:
Object.toString()

numberValueOf

public Number numberValueOf(Object referent)
Description copied from class: AbstractXOperator
This implementation returns the number value of the referent based on its string value. May return an arbitrary-precision signed decimal number.

Specified by:
numberValueOf in interface XOperator
Overrides:
numberValueOf in class AbstractXOperator
Parameters:
referent - The referent.
Returns:
Its number value.
See Also:
AbstractXOperator.stringValueOf(Object), NumberOperator.parseNumber(String)

booleanValueOf

public boolean booleanValueOf(Object referent)
Description copied from class: AbstractXOperator
This implementation returns the boolean value of the referent based on its string value.

Specified by:
booleanValueOf in interface XOperator
Overrides:
booleanValueOf in class AbstractXOperator
Parameters:
referent - The referent.
Returns:
Its boolean value.
See Also:
AbstractXOperator.stringValueOf(Object)

valueOf

public Object valueOf(Object referent)
Return the first item in the array or null.

Specified by:
valueOf in interface XOperator
Overrides:
valueOf in class AbstractXOperator
Parameters:
referent - The referent.
Returns:
The first item in the array or null.

getNodeType

public short getNodeType(Object referent)
The referent behaves like an element.

Specified by:
getNodeType in interface XOperator
Overrides:
getNodeType in class AbstractXOperator
Parameters:
referent - The referent object.
Returns:
This implementation returns "the element type".
See Also:
XType.ELEMENT_NODE

getTypeName

public QName getTypeName(Object referent)
Return #adt:list.

Specified by:
getTypeName in interface XOperator
Parameters:
referent - A list.
Returns:
adt:list

getIndex

public int getIndex(Object referent)
Return the intrinsic position of an object, that is to say 0.

Specified by:
getIndex in interface XOperator
Overrides:
getIndex in class AbstractXOperator
Parameters:
referent - The referent object.
Returns:
0.
See Also:
#getNaturalSize(Object), AbstractXOperator.getTypeIndex(Object), AbstractXOperator.getFamilyIndex(Object), AbstractXOperator.getNameIndex(Object)

getSize

public int getSize(Object referent)
Return the intrinsic size of an object, that is to say 0.

Specified by:
getSize in interface XOperator
Overrides:
getSize in class AbstractXOperator
Parameters:
referent - The referent object.
Returns:
0.
See Also:
#getNaturalIndex(Object), AbstractXOperator.getTypeSize(Object), AbstractXOperator.getFamilySize(Object), AbstractXOperator.getNameSize(Object)

getTypeIndex

public int getTypeIndex(Object referent)
Return the intrinsic position of this item amongs items of the same type, that is to say 0.

Specified by:
getTypeIndex in interface XOperator
Overrides:
getTypeIndex in class AbstractXOperator
Parameters:
referent - The referent object.
Returns:
0.

getTypeSize

public int getTypeSize(Object referent)
Return the intrinsic size of this item amongs items of the same type, that is to say 0.

Specified by:
getTypeSize in interface XOperator
Overrides:
getTypeSize in class AbstractXOperator
Parameters:
referent - The referent object.
Returns:
0;

getFamilyIndex

public int getFamilyIndex(Object referent)
Return the intrinsic position of this item amongs items of the same family, that is to say 0.

Specified by:
getFamilyIndex in interface XOperator
Overrides:
getFamilyIndex in class AbstractXOperator
Parameters:
referent - The referent object.
Returns:
0;

getFamilySize

public int getFamilySize(Object referent)
Return the intrinsic size of this item amongs items of the same family, that is to say 0.

Specified by:
getFamilySize in interface XOperator
Overrides:
getFamilySize in class AbstractXOperator
Parameters:
referent - The referent object.
Returns:
0;

getNameIndex

public int getNameIndex(Object referent)
Return the intrinsic position of this item amongs items of the same name, that is to say 0.

Specified by:
getNameIndex in interface XOperator
Overrides:
getNameIndex in class AbstractXOperator
Parameters:
referent - The referent object.
Returns:
0;

getNameSize

public int getNameSize(Object referent)
Return the intrinsic position of this item amongs items of the same name, that is to say 0.

Specified by:
getNameSize in interface XOperator
Overrides:
getNameSize in class AbstractXOperator
Parameters:
referent - The referent object.
Returns:
0;