net.ponder2.objects
Class P2String

java.lang.Object
  extended by net.ponder2.objects.P2Object
      extended by net.ponder2.objects.P2String
All Implemented Interfaces:
java.io.Serializable, P2Serializable, ManagedObject, Ponder2Message

public class P2String
extends P2Object
implements ManagedObject

TODO Description

Version:
$Id:$
Author:
Kevin Twidle
See Also:
Serialized Form

Constructor Summary
P2String()
          constructor for Ponder2 serialisation
P2String(java.lang.String value)
          Creates a string with an initial value
 
Method Summary
 java.lang.String add(java.lang.String aString)
          Answers this string and aString concatenated together
 boolean asBoolean()
          Returns itself as a boolean
 java.math.BigDecimal asNumber()
          Returns itself as a BigDecimal number
 P2Object asObject()
          Answers the managed object referred to by the pathname in the receiver
 java.lang.String asString()
          Returns itself
 P2XML asXML()
          Answers an XML representation of the receiver
 boolean equals(java.lang.Object obj)
           
 boolean equals(java.lang.String aString)
          Answers true if this string and aString are the same
 int hashCode()
           
 boolean isEmpty()
          Answers true if this string is the empty string
 boolean nequals(java.lang.String aString)
          Answers true if this string and aString are different
 P2Object readXml(com.twicom.qdparser.TaggedElement xml, java.util.Map<java.lang.Integer,P2Serializable> read)
           
 java.lang.String times(int aNumber)
          Answers aNumber copies of the original string concatenated together
 java.lang.String toString()
           
 com.twicom.qdparser.TaggedElement writeXml(java.util.Set<P2Object> written)
           
 
Methods inherited from class net.ponder2.objects.P2Object
asArray, asBlock, asClass, asDouble, asFloat, asHash, asInteger, asLong, asP2Array, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, fromXml, getManagedObject, getOID, getSMC, operation, operation, setSMC
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

P2String

public P2String()
constructor for Ponder2 serialisation


P2String

public P2String(java.lang.String value)
Creates a string with an initial value

Parameters:
value - the initial value for this string
Method Detail

asString

public java.lang.String asString()
                          throws Ponder2ArgumentException
Returns itself

Overrides:
asString in class P2Object
Returns:
the string itself
Throws:
Ponder2ArgumentException

asBoolean

public boolean asBoolean()
                  throws Ponder2ArgumentException
Description copied from class: P2Object
Returns itself as a boolean

Overrides:
asBoolean in class P2Object
Returns:
the boolean value
Throws:
Ponder2ArgumentException

asNumber

public java.math.BigDecimal asNumber()
                              throws Ponder2ArgumentException
Description copied from class: P2Object
Returns itself as a BigDecimal number

Overrides:
asNumber in class P2Object
Returns:
the BigDecimal value
Throws:
Ponder2ArgumentException

isEmpty

public boolean isEmpty()
Answers true if this string is the empty string

Returns:
true is this string is empty

add

public java.lang.String add(java.lang.String aString)
Answers this string and aString concatenated together

Parameters:
aString - the string to be concatenated after this
Returns:
this + aString

equals

public boolean equals(java.lang.String aString)
Answers true if this string and aString are the same

Parameters:
aString - the string to be compared with
Returns:
this == aString

nequals

public boolean nequals(java.lang.String aString)
Answers true if this string and aString are different

Parameters:
aString - the string to be compared with
Returns:
this != aString

times

public java.lang.String times(int aNumber)
Answers aNumber copies of the original string concatenated together

Parameters:
aNumber - the number of copies required
Returns:
this string as aNumber copies

asXML

public P2XML asXML()
            throws Ponder2ArgumentException
Answers an XML representation of the receiver

Returns:
the string as an XML structure
Throws:
Ponder2ArgumentException

asObject

public P2Object asObject()
                  throws Ponder2Exception
Answers the managed object referred to by the pathname in the receiver

Returns:
the object found by using this as a pathname
Throws:
Ponder2Exception

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

writeXml

public com.twicom.qdparser.TaggedElement writeXml(java.util.Set<P2Object> written)
                                           throws Ponder2OperationException
Specified by:
writeXml in interface P2Serializable
Overrides:
writeXml in class P2Object
Throws:
Ponder2OperationException

readXml

public P2Object readXml(com.twicom.qdparser.TaggedElement xml,
                        java.util.Map<java.lang.Integer,P2Serializable> read)
Specified by:
readXml in interface P2Serializable
Specified by:
readXml in class P2Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Copyright © 2008 Imperial College. All Rights Reserved.