Class Rider
- java.lang.Object
-
- org.deepjava.runtime.mpc555.driver.ffs.Rider
-
public class Rider extends Object
Rider, to be placed onto a file
multiple riders might be placed for reading and writing
-
-
Field Summary
Fields Modifier and Type Field Description boolean
eof
end of file reachedint
res
result of last operation = 0, operation successful = 1, end of file reached = 2, file does not exist = 3, no blocks left in file system = 4, max number of blocks for this file is exceeded = 5, writing not at end of file
-
Constructor Summary
Constructors Constructor Description Rider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description File
base()
Returns file associated with this rider.int
pos()
Returns position of rider.boolean
readBool()
reads booleanbyte
readByte()
reads byteint
readInt()
reads intshort
readShort()
reads shortvoid
set(File f, int pos)
sets rider at position if pos < 0, sets position to 0 if pos > length of file, sets position to file.lenvoid
writeBool(boolean x)
writes booleanvoid
writeByte(byte x)
writes bytevoid
writeInt(int x)
writes intvoid
writeShort(short x)
writes short
-
-
-
Method Detail
-
set
public void set(File f, int pos)
sets rider at position if pos < 0, sets position to 0 if pos > length of file, sets position to file.len- Parameters:
f
- filepos
- position (in number of bytes)
-
pos
public int pos()
Returns position of rider.- Returns:
- Position of rider in byte offset.
-
base
public File base()
Returns file associated with this rider.- Returns:
- File where this rider is placed on.
-
readBool
public boolean readBool()
reads boolean- Returns:
- Boolean value.
-
readByte
public byte readByte()
reads byte- Returns:
- Byte value.
-
readShort
public short readShort()
reads short- Returns:
- Short value.
-
readInt
public int readInt()
reads int- Returns:
- Integer value.
-
writeBool
public void writeBool(boolean x)
writes boolean- Parameters:
x
- Boolean value.
-
writeByte
public void writeByte(byte x)
writes byte- Parameters:
x
- Byte value.
-
writeShort
public void writeShort(short x)
writes short- Parameters:
x
- Short value.
-
writeInt
public void writeInt(int x)
writes int- Parameters:
x
- Integer value.
-
-