uk.ac.starlink.splat.ast
Class ASTChannel

java.lang.Object
  extended by uk.ac.starlink.ast.AstObject
      extended by uk.ac.starlink.ast.Channel
          extended by uk.ac.starlink.splat.ast.ASTChannel

public class ASTChannel
extends uk.ac.starlink.ast.Channel

AST Channel for reading and writing native encodings using String arrays.


Field Summary
 
Fields inherited from class uk.ac.starlink.ast.AstObject
AST__BAD, AST__TUNULL, pointer
 
Constructor Summary
ASTChannel(String[] astArray)
          Creates a Channel from a String array
 
Method Summary
static void astWrite(uk.ac.starlink.ast.AstObject object)
           
 int getIndex()
          Get the array position index.
 int getSize()
          Get the size of the backing String array.
 void setArray(String[] astArray)
          Replace the String array.
 void setIndex(int position)
          Set the array position index.
protected  void sink(String line)
          Sink function.
protected  String source()
          Read the next line from the array.
 
Methods inherited from class uk.ac.starlink.ast.Channel
copy, finalize, getComment, getFull, getReportLevel, getSkip, getStrict, read, setComment, setFull, setReportLevel, setSkip, setStrict, warnings, write
 
Methods inherited from class uk.ac.starlink.ast.AstObject
annul, clear, delete, equals, getAstConstantI, getB, getC, getD, getF, getI, getID, getIdent, getL, getNobject, getObjSize, getRefCount, hashCode, isThreaded, reportVersions, sameObject, set, setB, setC, setD, setF, setI, setID, setIdent, setL, show, test, tune
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ASTChannel

public ASTChannel(String[] astArray)
Creates a Channel from a String array

Parameters:
astArray - array holding an AST native encoding. Note that a reference to this is kept so any modifications will be seen.
Method Detail

source

protected String source()
                 throws IOException
Read the next line from the array. If past end return null.

Overrides:
source in class uk.ac.starlink.ast.Channel
Throws:
IOException

sink

protected void sink(String line)
Sink function. Note that a String is added to the input array at the current position. If this exceeds the initial storage then the line is quietly thrown away, however the array index is still incremented, so a later query can determine how much storage was required.

Overrides:
sink in class uk.ac.starlink.ast.Channel

setIndex

public void setIndex(int position)
Set the array position index.


getIndex

public int getIndex()
Get the array position index.


getSize

public int getSize()
Get the size of the backing String array.


setArray

public void setArray(String[] astArray)
Replace the String array.


astWrite

public static void astWrite(uk.ac.starlink.ast.AstObject object)


Copyright © 2018 Central Laboratory of the Research Councils. All Rights Reserved.