You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by jk...@apache.org on 2002/05/31 22:46:55 UTC

cvs commit: xml-xalan/java/src/org/apache/xpath/objects XString.java XStringForChars.java XStringForFSB.java

jkesselm    2002/05/31 13:46:55

  Modified:    java/src/org/apache/xpath/objects Tag: Xalan3 XString.java
                        XStringForChars.java XStringForFSB.java
  Log:
  I'm trying to avoid propigating the XNI interfaces into too much of the
  Xalan code... so unlike the SAX solution where we passed the
  handler down into the low-level classes for serialization, I'm using
  an enumeration to pull the data up to where DTM2XNI can access it.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.10.4.1  +9 -0      xml-xalan/java/src/org/apache/xpath/objects/XString.java
  
  Index: XString.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/objects/XString.java,v
  retrieving revision 1.10
  retrieving revision 1.10.4.1
  diff -u -r1.10 -r1.10.4.1
  --- XString.java	22 Mar 2002 01:04:44 -0000	1.10
  +++ XString.java	31 May 2002 20:46:55 -0000	1.10.4.1
  @@ -273,6 +273,15 @@
     {
       return (null != m_obj) ? ((String) m_obj) : "";
     }
  +  
  +  /** Yield result object's string value as a sequence of Character Blocks
  +	* @return a CharacterBlockEnumeration displaying the contents of
  +	* this object's string value (as in str()). May be empty.
  +	* */
  +  public org.apache.xml.utils.CharacterBlockEnumeration enumerateCharacterBlocks()
  +  {
  +  	return new org.apache.xml.utils.CharacterBlockEnumeration(str());
  +  }
   
     /**
      * Cast result object to a result tree fragment.
  
  
  
  1.5.12.1  +10 -0     xml-xalan/java/src/org/apache/xpath/objects/XStringForChars.java
  
  Index: XStringForChars.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/objects/XStringForChars.java,v
  retrieving revision 1.5
  retrieving revision 1.5.12.1
  diff -u -r1.5 -r1.5.12.1
  --- XStringForChars.java	26 Aug 2001 06:00:35 -0000	1.5
  +++ XStringForChars.java	31 May 2002 20:46:55 -0000	1.5.12.1
  @@ -100,6 +100,16 @@
     }
     
   
  +  /** Yield result object's string value as a sequence of Character Blocks
  +	* @return a CharacterBlockEnumeration displaying the contents of
  +	* this object's string value (as in str()). May be empty.
  +	* */
  +  public org.apache.xml.utils.CharacterBlockEnumeration enumerateCharacterBlocks()
  +  {
  +  	return new org.apache.xml.utils.CharacterBlockEnumeration(
  +		(char[])m_obj, m_start, m_length);
  +  }
  +
     /**
      * Since this object is incomplete without the length and the offset, we 
      * have to convert to a string when this function is called.
  
  
  
  1.15.4.1  +18 -0     xml-xalan/java/src/org/apache/xpath/objects/XStringForFSB.java
  
  Index: XStringForFSB.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/objects/XStringForFSB.java,v
  retrieving revision 1.15
  retrieving revision 1.15.4.1
  diff -u -r1.15 -r1.15.4.1
  --- XStringForFSB.java	22 Mar 2002 01:04:44 -0000	1.15
  +++ XStringForFSB.java	31 May 2002 20:46:55 -0000	1.15.4.1
  @@ -201,6 +201,24 @@
   
       return m_strCache;
     }
  +  
  +  /** Yield result object's string value as a sequence of Character Blocks
  +	* @return a CharacterBlockEnumeration displaying the contents of
  +	* this object's string value (as in str()). May be empty, may
  +	* yield multiple blocks depending on the FSB's contents. (The latter
  +	* case is why we need to enumerate, of course!)
  +	* */
  +  public org.apache.xml.utils.CharacterBlockEnumeration enumerateCharacterBlocks()
  +  {
  +  	// %REVIEW% %OPT% I'm not sure this is an optimization. Depends on
  +  	// how retrieval of char[] from String works in any given JVM.
  +  	// See comments in CharacterBlockEnumeration, and run some tests.
  +    if (null != m_strCache)
  +    	return new org.apache.xml.utils.CharacterBlockEnumeration(m_strCache);
  +	else  	
  +	  	return fsb().enumerateCharacterBlocks(m_start,m_length);
  +  }
  +  
   
     /**
      * Directly call the
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org