FileDocCategorySizeDatePackage
parser.javaAPI DocExample47539Sat Nov 25 11:54:30 GMT 2000None

Buffer

public class Buffer extends Vector

Fields Summary
Constructors Summary
Buffer(int iCapacity)

		super(iCapacity);
	
Methods Summary
public voidAdd(int iByte)

		addElement(new Character((char)iByte));
	
public voidAdd(char c)

		addElement(new Character(c));
	
public charAt(int iLoc)

		
				
		try{
		    			
			return ((Character) elementAt(iLoc)).charValue();
		 }
		 
		 catch (Throwable e) {System.out.println(e);}
		
			return '$";
	
voidConcatenate(Buffer bufOther)

		int iSize = bufOther.size();
		for(int i = 0; i < iSize; i ++)
			addElement(new Character(bufOther.At(i)) );

	
voidConcatenate(java.lang.String strBuf)

		int iLen = strBuf.length();
		for(int i = 0; i < iLen; i++)
		    Add(strBuf.charAt(i));
	
booleanStartsWithComment()

		int iSize = size(), i = 0;
		char ch;
		if(iSize == 0) return false;
		
		do{
			ch = At(i++);
		}while(i < iSize && Character.isSpace(ch));

		if(ch == '/"){
			for(int j = i; j < i+2; j++)
				if(At(j)!='*")
				  return false;
			return true;
		}

		else return false;
	
public synchronized voidWriteOut()

  //to stdio
		
		Enumeration enum = elements();
		
		for(;enum.hasMoreElements();){
			 Character Char = (Character)(enum.nextElement());
			 System.out.print(Char.charValue());
        }
	 
	
public synchronized voidWriteOut(java.io.DataOutputStream dos)
Purpose: Writes this object to DataOutputStream

		
		int iSize = size();
		
		
		try{
		
			for(int i = 0; i < iSize; i ++){
				
				char ch = At(i);
				dos.writeByte(At(i));
				
			}
			
		} catch(IOException e){System.out.println("IO error in Buffer WriteOut(dos)");}