Gephi Toolkit Javadoc

org.gephi.preview.plugin.items
Class AbstractItem

java.lang.Object
  extended by org.gephi.preview.plugin.items.AbstractItem
All Implemented Interfaces:
Item
Direct Known Subclasses:
EdgeItem, EdgeLabelItem, NodeItem, NodeLabelItem

public abstract class AbstractItem
extends java.lang.Object
implements Item

Author:
Mathieu Bastian

Field Summary
protected  java.util.Map<java.lang.String,java.lang.Object> data
           
protected  java.lang.Object source
           
protected  java.lang.String type
           
 
Fields inherited from interface org.gephi.preview.api.Item
EDGE, EDGE_LABEL, NODE, NODE_LABEL
 
Constructor Summary
AbstractItem(java.lang.Object source, java.lang.String type)
           
 
Method Summary
 java.util.Map<java.lang.String,java.lang.Object> getData()
           
<D> D
getData(java.lang.String key)
          Returns data associated to this item.
 java.lang.String[] getKeys()
          Returns all the keys.
 java.lang.Object getSource()
          Returns the source of the item.
 java.lang.String getType()
          Returns the type of the item.
 void setData(java.lang.String key, java.lang.Object value)
          Sets data to this item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

protected final java.lang.String type

source

protected final java.lang.Object source

data

protected final java.util.Map<java.lang.String,java.lang.Object> data
Constructor Detail

AbstractItem

public AbstractItem(java.lang.Object source,
                    java.lang.String type)
Method Detail

getType

public java.lang.String getType()
Description copied from interface: Item
Returns the type of the item. Default types are Item.NODE, Item.EDGE, Item.NODE_LABEL and Item.EDGE_LABEL.

Specified by:
getType in interface Item
Returns:
the item's type

getSource

public java.lang.Object getSource()
Description copied from interface: Item
Returns the source of the item. The source is usually a graph object like a Node or Edge.

Specified by:
getSource in interface Item
Returns:
the item's source object

getData

public <D> D getData(java.lang.String key)
Description copied from interface: Item
Returns data associated to this item.

Specified by:
getData in interface Item
Type Parameters:
D - the type of the data
Parameters:
key - the key
Returns:
the value associated to key, or null if not exist

setData

public void setData(java.lang.String key,
                    java.lang.Object value)
Description copied from interface: Item
Sets data to this item.

Specified by:
setData in interface Item
Parameters:
key - the key
value - the value to be associated with key

getData

public java.util.Map<java.lang.String,java.lang.Object> getData()

getKeys

public java.lang.String[] getKeys()
Description copied from interface: Item
Returns all the keys. That allows to enumerate all data associated with this item.

Specified by:
getKeys in interface Item
Returns:
all keys

Gephi Toolkit Javadoc