obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
-//removed because no packages
-//package java.io;
+
+//package java.io; //NO PACKAGES FOR CLASS FILES
/**
* This abstract class forms the base of the hierarchy of classes that read
*/
@LATTICE("")
@METHODDEFAULT("OUT<IN,THISLOC=IN,GLOBALLOC=IN")
-public abstract class InputStream
+ public abstract class InputStream //implements Closeable //COMPILER CANNOT HANDLE IMPLEMENTS
{
/**
* Default, no-arg, public constructor
*
* @exception IOException If an error occurs
*/
- @RETURNLOC("")
+ @RETURNLOC("OUT")
public int available() throws IOException
{
return 0;
* @return <code>true</code> if mark/reset functionality is
* supported, <code>false</code> otherwise
*/
- @RETURN
+ @RETURNLOC("OUT")
public boolean markSupported()
{
return false;
*
* @exception IOException If an error occurs.
*/
- @RETURN
+ @RETURNLOC("OUT")
public int read(@LOC("IN") byte[] b) throws IOException
{
return read(b, 0, b.length);
*
* @exception IOException If an error occurs.
*/
- @LATTICE("OUT<")
- @RETURN("")
- public int read(byte[] b, int off, int len) throws IOException
+ @LATTICE("OUT<SH,SH<IN,SH*")
+ @RETURNLOC("OUT")
+ public int read(@LOC("OUT") byte[] b, @LOC("IN") int off, @LOC("IN") int len) throws IOException
{
if (off < 0 || len < 0 || b.length - off < len)
throw new IndexOutOfBoundsException();
- int i, ch;
+ @LOC("SH") int i;
+ @LOC("SH") int ch;
for (i = 0; i < len; ++i)
try
* This method reads and discards bytes into a byte array until the
* specified number of bytes were skipped or until either the end of stream
* is reached or a read attempt returns a short count. Subclasses can
- * override this metho to provide a more efficient implementation where
+ * override this method to provide a more efficient implementation where
* one exists.
*
* @param n The requested number of bytes to skip
*
* @exception IOException If an error occurs
*/
+
public long skip(long n) throws IOException
{
// Throw away n bytes by reading them into a temp byte[].
byte[] tmpbuf = new byte[buflen];
final long origN = n;
- while (n > 0L)
+ while (n > 0)
{
- int numread = read(tmpbuf, 0, n > buflen ? buflen : (int) n);
+ int numread = read(tmpbuf, 0, n > buflen ? buflen : (int) n);
if (numread <= 0)
break;
n -= numread;
public static long max(long a, long b) {
return (a>b)?a:b;
}
-
- public static double min(double a, double b) {
+
+ @RETURNLOC("IN")
+ public static double min(@LOC("IN") double a, @LOC("IN") double b) {
return (a<b)?a:b;
}
* @author Aaron M. Renn (arenn@urbanophile.com)
* @author Warren Levy (warrenl@cygnus.com)
*/
-@LATTICE("IN<T,IN<SH,SH<F,SH*")
+@LATTICE("IN<T,IN<POS,POS<SH,SH<F,SH*,POS*")
@METHODDEFAULT("OUT<SH,SH<IN,SH*,THISLOC=OUT,GLOBALLOC=OUT")
public class PushbackInputStream extends FilterInputStream
{
* <code>pos</code> is 0 the buffer is full and <code>buf.length</code> when
* it is empty
*/
- @LOC("SH") protected int pos;
+ @LOC("POS") protected int pos;
/**
* This method initializes a <code>PushbackInputStream</code> to
*
* @exception IOException If an error occurs.
*/
- @LATTICE("OUT<SH,SH*,THISLOCAL=SH")
- @RETURNLOC("OUT")
- public synchronized int read(@LOC("OUT") byte[] b, @LOC("SH") int off, @LOC("SH") int len) throws IOException
+ @LATTICE("THIS<BUF,THISLOCAL=THIS")
+ @RETURNLOC("THIS")
+ public synchronized int read(@LOC("THIS,PushbackInputStream.POS") byte[] b,
+ @LOC("THIS,PushbackInputStream.POS") int off,
+ @LOC("THIS,PushbackInputStream.POS") int len) throws IOException
{
- @LOC("SH") int numBytes = Math.min(buf.length - pos,len);
+ @LOC("THIS,PushbackInputStream.POS") int numBytes = Math.min(buf.length - pos,len);
if (numBytes > 0)
{
private String() {
}
- public String(String str) {
+ public String(@LOC("IN") String str) {
this.value=str.value;
this.count=str.count;
this.offset=str.offset;
}
@LATTICE("O<V,V<C,C<IN,THISLOC=IN,C*")
+ @RETURNLOC("O")
public String concat(@LOC("IN") String str) {
@LOC("O") String newstr=new String(); // create new one, it has OUT location
@LOC("C") int newCount=this.count+str.count;
return newstr;
}
+ @RETURNLOC("O")
public boolean equals(@LOC("IN") Object o) {
if (o.getType()!=getType()) // values are coming from [IN] and [THISLOC]
return false;
return o.toString();
}
+ @LATTICE("O<V,V<C,C<IN,THISLOC=IN,C*")
+ @RETURNLOC("O")
public byte[] getBytes() {
- byte str[]=new byte[count];
- for(int i=0; i<count; i++)
+ @LOC("V") byte str[]=new byte[count];
+ for(@LOC("C") int i=0; i<count; i++)
str[i]=(byte)value[i+offset];
return str;
}
-
+
+ @RETURNLOC("IN")
public int length() {
return count;
}
- public static native int convertdoubletochar(double val, char [] chararray);
-
+ @RETURNLOC("O")
+ public char charAt(@LOC("IN") int index){
+ return value[index];
+ }
+ //public static native int convertdoubletochar(double val, char [] chararray);
}
+@LATTICE("")
+@METHODDEFAULT("OUT<IN")
public class System {
public static void printInt(int x) {
String s = String.valueOf(x);
public static native void printString(String s);
- public static void println(String s) {
+ public static void println(@LOC("IN") String s) {
System.printString(s + "\n");
}