ewe.database
Class MetaFlag

java.lang.Object
  extended byewe.database.MetaFlag

public class MetaFlag
extends Object

This represents a single integer value that can be stored in a Database using its MetaData facilities. After creating it you can call getValue() and saveValue() to read and write it to the database.


Constructor Summary
MetaFlag(String name, Database db)
          Create a MetaFlag with the specified name for the specified database.
 
Method Summary
 boolean canWrite()
           
 int getValue()
           
 boolean isSaved()
           
 void setValue(int value)
          This sets the current value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, toString
 

Constructor Detail

MetaFlag

public MetaFlag(String name,
                Database db)
         throws IOException
Create a MetaFlag with the specified name for the specified database. Note that if the db is open for read write this will automatically create and save the MetaData if it does not already exist.

Method Detail

isSaved

public boolean isSaved()

getValue

public int getValue()

canWrite

public boolean canWrite()

setValue

public void setValue(int value)
              throws IOException
This sets the current value. It is kept locally in a field and will only be written to the DB if it is different from what is stored on the DB.

Throws:
IOException