cz.cuni.amis.pogamut.episodic.schemas
Class SlotContent

Package class diagram package SlotContent
java.lang.Object
  extended by cz.cuni.amis.pogamut.episodic.schemas.SlotContent
All Implemented Interfaces:
Serializable

public class SlotContent
extends Object
implements Serializable

When the slot represented by this node is filled with an object node, it is linked with the node representing that item via the SlotContent class. Each SlotContent contains references to exactly one SchemaSlot and one SchemaObjectNode it is linking together.

Together with SchemaEpisodeNodes they form a set that is indexing different schema counters. They keep list of references to counters they contribute to.

Author:
Michal Cermak
See Also:
Serialized Form

Constructor Summary
SlotContent(int _id, SchemaSlot _slot, SchemaObjectNode _object)
          Instantiate the class by providing unique ID and references to both SchemaSlot and SchemaObjectNode that are to be connected by this slot content.
 
Method Summary
 void addCount(int key, SchemaCounter count)
          Each SlotContent keeps the list of references to counters it is contributing to (it is contained in set of nodes defining the counter).
 org.apache.commons.collections15.multimap.MultiHashMap<Integer,SchemaCounter> getCounts()
          Getter variable for counts variable.
 int getId()
          Getter method for the id variable.
 SchemaObjectNode getObject()
          Getter method for the object variable.
 SchemaSlot getSlot()
          Getter method for the slot variable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SlotContent

public SlotContent(int _id,
                   SchemaSlot _slot,
                   SchemaObjectNode _object)
Instantiate the class by providing unique ID and references to both SchemaSlot and SchemaObjectNode that are to be connected by this slot content.

Parameters:
_id - Unique ID of this slot content.
_slot - Reference to the SchemaSlot object on one end of the link between a slot and an object created by this new slot content.
_object - Reference to the SchemaObjectNode object on one end of the link between a slot and an object created by this new slot content.
Method Detail

getId

public int getId()
Getter method for the id variable.

Returns:
Returns ID of this node. Used as an ID of vertex representing this chronobag when visualizing Schemas.

getSlot

public SchemaSlot getSlot()
Getter method for the slot variable.

Returns:
Returns the reference to the SchemaSlot object on one end of the link between a slot and an object created by this new slot content.

getObject

public SchemaObjectNode getObject()
Getter method for the object variable.

Returns:
Returns the reference to the SchemaObjectNode object on one end of the link between a slot and an object created by this new slot content.

addCount

public void addCount(int key,
                     SchemaCounter count)
Each SlotContent keeps the list of references to counters it is contributing to (it is contained in set of nodes defining the counter). So when a new counter is created, that is co-defined by this slot content, it need to be added to this list.

This method adds a speficied counter to this list under a specified key.

Parameters:
key - Index of the new SchemaCounter. It is the key of the counter minus the ID of current slot content.
count - Reference to the SchemaCounter that should be added to the list (actually a map) of counters.

getCounts

public org.apache.commons.collections15.multimap.MultiHashMap<Integer,SchemaCounter> getCounts()
Getter variable for counts variable.

counts is a collection of all SchemaCounters this node contributes to. In order to quickly access any counter, counters are indexed in a multihashmap. Index of a counter is calculated as the sum of IDs of all nodes it refers to, but when accessing a counter from the inside of the node, nodes id is not added to the sum. So a single counters of nodes can always be accessed on zero index.

Returns:
Returns a set of all schema counters this slot content is participating in.


Copyright © 2013 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.