de.uni_bremen.st.rcf.model
Class Entry

java.lang.Object
  extended by de.uni_bremen.st.rcf.model.Entry
Direct Known Subclasses:
CloneClass, ClonePair, Directory, File, Fragment, Metadata, ProcessData, SourcePosition, Version

public class Entry
extends Object

The standard implementation for any Entry in a RCF relation. Provides access methods for any kind of attribute. Use this class to access RCF entries if no specific implementation exists.

Author:
harder

Method Summary
 Entry copy(RCF toRCF)
          Copies the Entry to another RCF, including lists.
 boolean equals(Object obj)
           
 boolean getBool(Attribute a)
          Get the value of the boolean attribute a.
 boolean getBool(Attribute a, boolean defaultValue)
          Get the value the boolean attribute a.
 boolean getBool(String attributeName)
          Get the value of the boolean attribute named like attributeName.
 boolean getBool(String attributeName, boolean defaultValue)
          Get the value of the boolean attribute named like attributeName.
 List<Boolean> getBoolList(Attribute a)
           
 List<Boolean> getBoolList(String attributeName)
           
 Entry getEntry(Attribute a)
           
 Entry getEntry(Attribute a, Entry defaultValue)
           
 Entry getEntry(String attributeName)
           
 Entry getEntry(String attributeName, Entry defaultValue)
           
 List<Entry> getEntryList(Attribute a)
           
 List<Entry> getEntryList(String attributeName)
           
 EntryType getEntryType()
          Get the type of this entry.
 float getFloat(Attribute a)
          Get the value of the float attribute a.
 float getFloat(Attribute a, float defaultValue)
          Get the value of the float attribute a.
 float getFloat(String attributeName)
          Get the value of the integer attribute named like attributeName.
 float getFloat(String attributeName, float defaultValue)
          Get the value of the float attribute named like attributeName.
 List<Float> getFloatList(Attribute a)
           
 List<Float> getFloatList(String attributeName)
           
 int getId()
          Get the id of the entry.
 int getInt(Attribute a)
          Get the value of the integer attribute a.
 int getInt(Attribute a, int defaultValue)
          Get the value of the integer attribute a.
 int getInt(String attributeName)
          Get the value of the integer attribute named like attributeName.
 int getInt(String attributeName, int defaultValue)
          Get the value of the integer attribute named like attributeName.
 List<Integer> getIntList(Attribute a)
           
 List<Integer> getIntList(String attributeName)
           
 Relation<? extends Entry> getRelation()
          Get the relation this entry belongs to
 String getString(Attribute a)
          Get the value of the string attribute a.
 String getString(Attribute a, String defaultValue)
          Get the value the string attribute a.
 String getString(String attributeName)
          Get the value of the string attribute named like attributeName.
 String getString(String attributeName, String defaultValue)
          Get the value of the string attribute named like attributeName.
 List<String> getStringList(Attribute a)
           
 List<String> getStringList(String attributeName)
           
 int hashCode()
           
 boolean isSet(Attribute a)
          Checks whether the given attribute's value is set.
 boolean isSet(String attributeName)
          Checks whether the given attribute's value is set.
 void setBool(Attribute a, boolean value)
          Set the value of the boolean attribute a to the specified value.
 void setBool(String attributeName, boolean value)
          Set the value of the boolean attribute named like attributeName to value.
 void setEntry(Attribute a, Entry value)
           
 void setEntry(String attributeName, Entry value)
           
 void setFloat(Attribute a, float value)
          Set the value of the float attribute a to the specified value.
 void setFloat(String attributeName, float value)
          Set the value of the float attribute named like attributeName to value.
 void setInt(Attribute a, int value)
          Set the value of attribute a to value.
 void setInt(String attributeName, int value)
          Set the value of the attribute named like attributeName to value.
 void setString(Attribute a, String value)
          Set the value of the string attribute a to the specified value.
 void setString(String attributeName, String value)
          Set the value of the string attribute named like attributeName to value.
 void store()
          Stores any changed applied to the entry in the rcf file.
 void unset(Attribute ab)
           
 void unset(String attributeName)
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getRelation

public Relation<? extends Entry> getRelation()
Get the relation this entry belongs to

Returns:
the Relation

getEntryType

public EntryType getEntryType()
Get the type of this entry.

Returns:
the type

getId

public int getId()
Get the id of the entry. RCF assigns an id to each tuple. ID are unique within one relation.

Returns:
the id

isSet

public boolean isSet(Attribute a)
Checks whether the given attribute's value is set.


isSet

public boolean isSet(String attributeName)
Checks whether the given attribute's value is set. Use the other isSet method where possible for better perfomance.


getInt

public int getInt(Attribute a)
Get the value of the integer attribute a.

Parameters:
a - the integer attribute
Returns:
the value
Throws:
ValueNotSetException - if the value is not set

getInt

public int getInt(Attribute a,
                  int defaultValue)
Get the value of the integer attribute a.

Parameters:
a - the integer attribute
defaultValue - the default value, which is returned if the attribute is not set.
Returns:
the value if a is set, defaultValue else

getInt

public int getInt(String attributeName)
Get the value of the integer attribute named like attributeName.

Parameters:
attributeName - the name of the requested attribute
Returns:
the value of the attribute
Throws:
ValueNotSetException - if the value is not set

getInt

public int getInt(String attributeName,
                  int defaultValue)
Get the value of the integer attribute named like attributeName.

Parameters:
attributeName - the name of the requested attribute
defaultValue - the default value, which is returned if the attribute is not set.
Returns:
the value if the attribute is set, defaultValue else

setInt

public void setInt(Attribute a,
                   int value)
Set the value of attribute a to value.

Parameters:
a - the attribute
value - the value

setInt

public void setInt(String attributeName,
                   int value)
Set the value of the attribute named like attributeName to value.

Parameters:
attributeName - the name of the attribute whose value should be set
value - the value

getFloat

public float getFloat(Attribute a)
Get the value of the float attribute a.

Parameters:
a - the attribute
Returns:
the value
Throws:
ValueNotSetException - if the value is not set

getFloat

public float getFloat(Attribute a,
                      float defaultValue)
Get the value of the float attribute a.

Parameters:
a - the float attribute
defaultValue - the default value, which is returned if the attribute is not set
Returns:
the value of a, if it is set, defaultValue else

getFloat

public float getFloat(String attributeName)
Get the value of the integer attribute named like attributeName.

Parameters:
attributeName - the name of the requested attribute
Returns:
the value of the attribute
Throws:
ValueNotSetException - if the value is not set

getFloat

public float getFloat(String attributeName,
                      float defaultValue)
Get the value of the float attribute named like attributeName.

Parameters:
attributeName - the name of the requested attribute
defaultValue - the default value, which is returned if the attribute is not set
Returns:
the value of the attribute if it is set, defaultValue else

setFloat

public void setFloat(Attribute a,
                     float value)
Set the value of the float attribute a to the specified value.

Parameters:
a - the attribute whose value should be set
value - the value

setFloat

public void setFloat(String attributeName,
                     float value)
Set the value of the float attribute named like attributeName to value.

Parameters:
attributeName - the name of the attribute whose value should be set
value - the value

getString

public String getString(Attribute a)
Get the value of the string attribute a.

Parameters:
a - the attribute
Returns:
the value
Throws:
ValueNotSetException - if the value is not set

getString

public String getString(Attribute a,
                        String defaultValue)
Get the value the string attribute a.

Parameters:
a - the attribute
defaultValue - the default value, which is returned if the attribute is not set
Returns:
the value of a, if it is set, defaultValue else

getString

public String getString(String attributeName)
Get the value of the string attribute named like attributeName.

Parameters:
attributeName - the name of the requested attribute
Returns:
the value
Throws:
ValueNotSetException - if the value is not set

getString

public String getString(String attributeName,
                        String defaultValue)
Get the value of the string attribute named like attributeName.

Parameters:
attributeName - the name of the requested attribute
defaultValue - the default value, which is returned if the attribute is not set
Returns:
the value of the attribute if it is set, defaultValue else

setString

public void setString(Attribute a,
                      String value)
Set the value of the string attribute a to the specified value.

Parameters:
a - the attribute whose value should be set
value - the value

setString

public void setString(String attributeName,
                      String value)
Set the value of the string attribute named like attributeName to value.

Parameters:
attributeName - the name of the attribute whose value should be set
value - the value

getBool

public boolean getBool(Attribute a)
Get the value of the boolean attribute a.

Parameters:
a - the attribute
Returns:
the value
Throws:
ValueNotSetException - if the value is not set

getBool

public boolean getBool(Attribute a,
                       boolean defaultValue)
Get the value the boolean attribute a.

Parameters:
a - the attribute
defaultValue - the default value, which is returned if the attribute is not set
Returns:
the value of a, if it is set, defaultValue else

getBool

public boolean getBool(String attributeName)
Get the value of the boolean attribute named like attributeName.

Parameters:
attributeName - the name of the requested attribute
Returns:
the value
Throws:
ValueNotSetException - if the value is not set

getBool

public boolean getBool(String attributeName,
                       boolean defaultValue)
Get the value of the boolean attribute named like attributeName.

Parameters:
attributeName - the name of the requested attribute
defaultValue - the default value, which is returned if the attribute is not set
Returns:
the value of the attribute if it is set, defaultValue else

setBool

public void setBool(Attribute a,
                    boolean value)
Set the value of the boolean attribute a to the specified value.

Parameters:
a - the attribute whose value should be set
value - the value

setBool

public void setBool(String attributeName,
                    boolean value)
Set the value of the boolean attribute named like attributeName to value.

Parameters:
attributeName - the name of the attribute whose value should be set
value - the value

getEntry

public Entry getEntry(Attribute a)

getEntry

public Entry getEntry(Attribute a,
                      Entry defaultValue)

getEntry

public Entry getEntry(String attributeName)

getEntry

public Entry getEntry(String attributeName,
                      Entry defaultValue)

setEntry

public void setEntry(Attribute a,
                     Entry value)

setEntry

public void setEntry(String attributeName,
                     Entry value)

getIntList

public List<Integer> getIntList(Attribute a)

getIntList

public List<Integer> getIntList(String attributeName)
                         throws NoSuchAttributeException
Throws:
NoSuchAttributeException

getFloatList

public List<Float> getFloatList(Attribute a)

getFloatList

public List<Float> getFloatList(String attributeName)
                         throws NoSuchAttributeException
Throws:
NoSuchAttributeException

getBoolList

public List<Boolean> getBoolList(Attribute a)

getBoolList

public List<Boolean> getBoolList(String attributeName)
                          throws NoSuchAttributeException
Throws:
NoSuchAttributeException

getStringList

public List<String> getStringList(Attribute a)

getStringList

public List<String> getStringList(String attributeName)
                           throws NoSuchAttributeException
Throws:
NoSuchAttributeException

getEntryList

public List<Entry> getEntryList(Attribute a)

getEntryList

public List<Entry> getEntryList(String attributeName)
                         throws NoSuchAttributeException
Throws:
NoSuchAttributeException

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

store

public void store()
Stores any changed applied to the entry in the rcf file. Do not forget to call store(). If you don't call store, your changes will not be reflected in the data model saved to the file!


copy

public Entry copy(RCF toRCF)
Copies the Entry to another RCF, including lists. References will not be copied.

Parameters:
toRCF -
Returns:
the copy of the entry in the other RCF.

unset

public void unset(String attributeName)

unset

public void unset(Attribute ab)


Copyright © 2011. All Rights Reserved.