de.mguennewig.pobjects.filesystem
Class FileRecord

java.lang.Object
  extended by de.mguennewig.pobjects.Record
      extended by de.mguennewig.pobjects.filesystem.FileRecord

public class FileRecord
extends Record

A (read-only) wrapper around a File to map it into pobjects.

This underlying File can not be manipulated with pobjects, it is just for read-only purposes.

Author:
Michael Günnewig

Field Summary
static Field ATTR_MODIFIED
           
static Field ATTR_NAME
           
static Field ATTR_PARENT
           
static Field ATTR_SIZE
           
static Field ATTR_TYPE
           
static TimeStampType ATYPE_MODIFIED
           
static StringType ATYPE_NAME
           
static StringType ATYPE_PARENT
           
static NumericType ATYPE_SIZE
           
static StringType ATYPE_TYPE
           
static ClassDecl CDECL_FILE_RECORD
           
static java.lang.String TYPE_DIRECTORY
           
static java.lang.String TYPE_FILE
           
static java.lang.String TYPE_INVALID
          The file name contains non-ASCII characters, which Java does not handle correctly.
static java.lang.String TYPE_SPECIAL
           
 
Constructor Summary
FileRecord(java.io.File file)
           
 
Method Summary
 java.lang.Object get(int f)
          Get value of field with index index.
 ClassDecl getClassDecl()
           
 java.io.File getFile()
           
 java.math.BigInteger getModified()
           
 java.lang.String getName()
           
 java.lang.String getParent()
           
 java.math.BigInteger getSize()
           
 TableExpr getTableExpr()
          Returns the metadata declaration for this Record.
 java.lang.String getType()
           
 void set(int f, java.lang.Object value)
          Set value of field with index index.
 
Methods inherited from class de.mguennewig.pobjects.Record
format, get, set
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_INVALID

public static final java.lang.String TYPE_INVALID
The file name contains non-ASCII characters, which Java does not handle correctly.

See Also:
Constant Field Values

TYPE_DIRECTORY

public static final java.lang.String TYPE_DIRECTORY
See Also:
Constant Field Values

TYPE_FILE

public static final java.lang.String TYPE_FILE
See Also:
Constant Field Values

TYPE_SPECIAL

public static final java.lang.String TYPE_SPECIAL
See Also:
Constant Field Values

ATYPE_PARENT

public static final StringType ATYPE_PARENT

ATTR_PARENT

public static final Field ATTR_PARENT

ATYPE_NAME

public static final StringType ATYPE_NAME

ATTR_NAME

public static final Field ATTR_NAME

ATYPE_SIZE

public static final NumericType ATYPE_SIZE

ATTR_SIZE

public static final Field ATTR_SIZE

ATYPE_TYPE

public static final StringType ATYPE_TYPE

ATTR_TYPE

public static final Field ATTR_TYPE

ATYPE_MODIFIED

public static final TimeStampType ATYPE_MODIFIED

ATTR_MODIFIED

public static final Field ATTR_MODIFIED

CDECL_FILE_RECORD

public static final ClassDecl CDECL_FILE_RECORD
Constructor Detail

FileRecord

public FileRecord(java.io.File file)
Method Detail

getClassDecl

public final ClassDecl getClassDecl()
See Also:
PObject.getClassDecl()

getTableExpr

public TableExpr getTableExpr()
Returns the metadata declaration for this Record.

Specified by:
getTableExpr in class Record

getFile

public final java.io.File getFile()

getParent

public final java.lang.String getParent()

getName

public final java.lang.String getName()

getSize

public final java.math.BigInteger getSize()

getType

public final java.lang.String getType()

getModified

public final java.math.BigInteger getModified()

get

public java.lang.Object get(int f)
Get value of field with index index.

This method is primarily intended for use by procedures that work on meta level of de.mguennewig.pobjects. It differs from the per field getXXX() methods in that it does not load the object's data if it is not in memory. If unsure whether the object's state has been internalized, then any call to this method must be preceded by a call to PObject.loadIfReference().

Specified by:
get in class Record

set

public final void set(int f,
                      java.lang.Object value)
Set value of field with index index.

This method is primarily intended for use by procedures that work on meta level of de.mguennewig.pobjects. It differs from the per field setXXX() methods in that it does not load the object's data if it is not in memory. If unsure whether the object's state has been internalized, then any call to this method must be preceded by a call to PObject.loadIfReference().

Specified by:
set in class Record
Throws:
java.lang.IllegalArgumentException - as this object can not be modified