本文整理汇总了Java中prefuse.data.Tuple.get方法的典型用法代码示例。如果您正苦于以下问题:Java Tuple.get方法的具体用法?Java Tuple.get怎么用?Java Tuple.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类prefuse.data.Tuple
的用法示例。
在下文中一共展示了Tuple.get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLiteral
import prefuse.data.Tuple; //导入方法依赖的package包/类
/**
* Evaluate the given tuple and data field and return the
* result as a new Literal instance.
* @param t the Tuple
* @param field the data field to lookup
* @return a new Literal expression containing the
* value of the Tuple's data field
*/
@SuppressWarnings("rawtypes")
public static Literal getLiteral(Tuple t, String field) {
Class type = t.getColumnType(field);
if ( type == int.class )
{
return new NumericLiteral(t.getInt(field));
}
else if ( type == long.class )
{
return new NumericLiteral(t.getLong(field));
}
else if ( type == float.class )
{
return new NumericLiteral(t.getFloat(field));
}
else if ( type == double.class )
{
return new NumericLiteral(t.getDouble(field));
}
else if ( type == boolean.class )
{
return new BooleanLiteral(t.getBoolean(field));
}
else
{
return new ObjectLiteral(t.get(field));
}
}
示例2: getInt
import prefuse.data.Tuple; //导入方法依赖的package包/类
public int getInt( Tuple t )
{
prefuse.data.Node node = (prefuse.data.Node)t.get( HVConstants.PREFUSE_INSTANCE_NODE_COLUMN_NAME );
return node.getInt( HVConstants.PREFUSE_NODE_ROLE_COLUMN_NAME );
}
示例3: getBoolean
import prefuse.data.Tuple; //导入方法依赖的package包/类
public boolean getBoolean(Tuple t) {
// only operate on nodes for now
if(!(t instanceof Node))
{
//System.out.println("Not a node!");
return true;
}
//System.out.println("Got a node!");
// check the bandwidth rank
if(min_bandwidth_enabled && min_bandwidth_rank > t.getFloat(Data.BANDWIDTH_RANK))
{
//System.out.println("Checking min bandwidth");
return false;
}
if(max_bandwidth_enabled && max_bandwidth_rank < t.getFloat(Data.BANDWIDTH_RANK))
{
//System.out.println("Checking max bandwidth");
return false;
}
// check the degree rank
if(min_degree_enabled && min_degree_rank > t.getFloat(Data.DEGREE_RANK))
{
//System.out.println("Checking min degree");
return false;
}
if(max_degree_enabled && max_degree_rank < t.getFloat(Data.DEGREE_RANK))
{
//System.out.println("Checking max degree");
return false;
}
// check the inet address
if(ip_filter_enabled)
{
InetAddress a = (InetAddress)t.get(Data.ADDRESS);
byte[] b_node = a.getAddress();
byte[] b_addr = filter_address.getAddress();
byte[] b_mask = filter_mask.getAddress();
for (int j=0; j<4; j++)
if ((b_addr[j] & b_mask[j]) != (b_node[j] & b_mask[j]))
return false;
}
return true;
}
示例4: get
import prefuse.data.Tuple; //导入方法依赖的package包/类
/**
* @see prefuse.data.expression.Expression#get(prefuse.data.Tuple)
*/
public Object get(Tuple t) {
return t.get(m_field);
}