The Meta-Environment API

nl.cwi.sen1.visbase.rstorecontainer.datatypes
Class FactInfoList

java.lang.Object
  extended by nl.cwi.sen1.visbase.rstorecontainer.datatypes.FactInfoList

public class FactInfoList
extends java.lang.Object

This class represents the list of 'RStore Fact-identification data' being communicated over the ToolBus. It can be used to automatically convert the ATerm(List) that is send over the ToolBus to the FactBrowser. Example: // The ATerm received by another Java tool
ATerm incomingAterm;

// Use the constructor that accepts an ATermList as argument
FactInfoList factInfoList = new FactInfoList((ATermList) incomingAterm);

//Iterate through FactInfo list
for (FactInfo factInfo : factInfoList.getFactInfos())
{
  // Access Fact information
  factInfo.getId();
  factInfo.getName();
  factInfo.getType();
}

Author:
Ricardo Lindooren, Arend van Beelen (reviewer)
See Also:
FactInfo

Field Summary
private  java.util.List<FactInfo> m_factInfoList
           
 
Constructor Summary
FactInfoList()
          Default constructor.
FactInfoList(aterm.ATermList termList)
          Constructor that initializes the list from an ATermList.
 
Method Summary
 void addFactInfoToList(FactInfo rStoreFactData)
          Adds a FactInfo object to this list.
 java.util.List<FactInfo> getFactInfos()
          Getter for the intern List instance
 aterm.ATermList toATermList()
          Creates a new ATermList containing the values in this datatype
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_factInfoList

private java.util.List<FactInfo> m_factInfoList
Constructor Detail

FactInfoList

public FactInfoList()
Default constructor. Creates an empty list.


FactInfoList

public FactInfoList(aterm.ATermList termList)
             throws ATermParseException
Constructor that initializes the list from an ATermList.

Parameters:
termList - ATermList containing fact data.
Throws:
ATermParseException - if parsing of ATermList fails.
java.lang.RuntimeException - if ATermList input is null.
Method Detail

addFactInfoToList

public void addFactInfoToList(FactInfo rStoreFactData)
Adds a FactInfo object to this list. Another option is to use the list directly with getFactInfos().

Parameters:
rStoreFactData -

getFactInfos

public java.util.List<FactInfo> getFactInfos()
Getter for the intern List instance

Returns:

toATermList

public aterm.ATermList toATermList()
Creates a new ATermList containing the values in this datatype

Returns:
new instance of ATermList

The Meta-Environment API