当前位置: 首页>>代码示例>>Java>>正文


Java NumericLiteral类代码示例

本文整理汇总了Java中prefuse.data.expression.NumericLiteral的典型用法代码示例。如果您正苦于以下问题:Java NumericLiteral类的具体用法?Java NumericLiteral怎么用?Java NumericLiteral使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


NumericLiteral类属于prefuse.data.expression包,在下文中一共展示了NumericLiteral类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: GranularityPredicate

import prefuse.data.expression.NumericLiteral; //导入依赖的package包/类
public GranularityPredicate(Granularity granularity,boolean ignoreContext) {
    super();

    if(ignoreContext) {       
    	super.add(new ComparisonPredicate(ComparisonPredicate.EQ,
    			new ColumnExpression(TemporalElement.GRANULARITY_ID),
    			new NumericLiteral(granularity.getIdentifier())));
    } else {               
    	super.add(new GranularityContextPredicate(granularity));
    	super.add(new ComparisonPredicate(ComparisonPredicate.EQ,
            new ColumnExpression(TemporalElement.GRANULARITY_ID),
            new NumericLiteral(granularity.getIdentifier())));
    }

    this.granularity = granularity;
    this.contextSet = !ignoreContext;
}
 
开发者ID:ieg-vienna,项目名称:TimeBench,代码行数:18,代码来源:GranularityPredicate.java

示例2: run

import prefuse.data.expression.NumericLiteral; //导入依赖的package包/类
@Override
public void run(double frac) {
    // get a visual table for line segments
    VisualTable lines = getTable();

    // get all nodes at depth-1
    VisualGraph graph = (VisualGraph) m_vis.getGroup(m_src);
    @SuppressWarnings("rawtypes")
    Iterator nodeIterator = graph.getNodeTable().tuples(
            new ComparisonPredicate(ComparisonPredicate.EQ,
                    new ColumnExpression(ParentChildNode.DEPTH),
                    new NumericLiteral(depth - 1)));

    // connect children of these nodes
    while (nodeIterator.hasNext()) {
        NodeItem node = (NodeItem) nodeIterator.next();
        // TODO assumption that children are ordered or reversely ordered
        super.connectPoints(lines, node.inNeighbors());
    }
}
 
开发者ID:ieg-vienna,项目名称:TimeBench,代码行数:21,代码来源:CyclePlotLineAction.java

示例3: KindPredicate

import prefuse.data.expression.NumericLiteral; //导入依赖的package包/类
/**
 * create a new KindPredicate
 * 
 * @param kind
 *            the kind code to match by this predicate
 */
public KindPredicate(int kind) {
    super(ComparisonPredicate.EQ,
            new ColumnExpression(TemporalElement.KIND), new NumericLiteral(
                    kind));
    this.kind = kind;
}
 
开发者ID:ieg-vienna,项目名称:TimeBench,代码行数:13,代码来源:KindPredicate.java

示例4: GranularityContextPredicate

import prefuse.data.expression.NumericLiteral; //导入依赖的package包/类
public GranularityContextPredicate(Granularity granularity) {
    super(ComparisonPredicate.EQ, new ColumnExpression(
            TemporalElement.GRANULARITY_CONTEXT_ID), new NumericLiteral(
            granularity.getGranularityContextIdentifier()));

    this.granularity = granularity;
}
 
开发者ID:ieg-vienna,项目名称:TimeBench,代码行数:8,代码来源:GranularityContextPredicate.java

示例5: children

import prefuse.data.expression.NumericLiteral; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Override
public Iterator children() {
    return m_table.tuples(new ComparisonPredicate(
            ComparisonPredicate.EQ, new ColumnExpression(FIELD_PARENT),
            new NumericLiteral(m_row)));
}
 
开发者ID:ieg-vienna,项目名称:ieg-prefuse,代码行数:8,代码来源:PointerTree.java

示例6: leaves

import prefuse.data.expression.NumericLiteral; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
public Iterator leaves() {
    super.index(FIELD_FIRST_CHILD);
    return super
            .tuples(new ComparisonPredicate(ComparisonPredicate.EQ,
                    new ColumnExpression(FIELD_FIRST_CHILD),
                    new NumericLiteral(-1)));
}
 
开发者ID:ieg-vienna,项目名称:ieg-prefuse,代码行数:9,代码来源:LinkedTree.java

示例7: UnaryExpression

import prefuse.data.expression.NumericLiteral; //导入依赖的package包/类
static final public Expression UnaryExpression() throws ParseException {
Expression e; Token t;
  switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  case ADD:
  case SUB:
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case ADD:
      t = jj_consume_token(ADD);
      break;
    case SUB:
      t = jj_consume_token(SUB);
      break;
    default:
      jj_la1[12] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
    e = UnaryExpression();
      if ( t.kind == SUB  && e instanceof NumericLiteral ) {
        Number n = (Number)e.get(null);
        if ( n instanceof Integer ) {
            {if (true) return new NumericLiteral(-1*n.intValue());}
        } if ( n instanceof Double ) {
            {if (true) return new NumericLiteral(-1*n.doubleValue());}
        } if ( n instanceof Long ) {
            {if (true) return new NumericLiteral(-1*n.longValue());}
        } if ( n instanceof Float ) {
            {if (true) return new NumericLiteral(-1*n.floatValue());}
        } else {
            {if (true) return new ArithmeticExpression(ArithmeticExpression.MUL,
                                            new NumericLiteral(-1), e);}
        }
      } else if ( t.kind == SUB ) {
        {if (true) return new ArithmeticExpression(ArithmeticExpression.MUL,
                                        new NumericLiteral(-1), e);}
      } else {
        {if (true) return e;}
      }
    break;
  case NOT:
    e = UnaryExpressionNotPlusMinus();
                                    {if (true) return e;}
    break;
  case TRUE:
  case FALSE:
  case NULL:
  case IF:
  case INT:
  case LONG:
  case DOUBLE:
  case FLOAT:
  case STRING:
  case QUOTED:
  case IDENTIFIER:
  case LPAREN:
    e = PrimaryExpression();
                          {if (true) return e;}
    break;
  default:
    jj_la1[13] = jj_gen;
    jj_consume_token(-1);
    throw new ParseException();
  }
  throw new Error("Missing return statement in function");
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:66,代码来源:ExpressionParser.java

示例8: Literal

import prefuse.data.expression.NumericLiteral; //导入依赖的package包/类
static final public Expression Literal() throws ParseException {
Token t;
  switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  case INT:
    t = jj_consume_token(INT);
            {if (true) return new NumericLiteral(Integer.parseInt(t.image));}
    break;
  case LONG:
    t = jj_consume_token(LONG);
             {if (true) return new NumericLiteral(Long.parseLong(t.image.substring(0,t.image.length()-1)));}
    break;
  case FLOAT:
    t = jj_consume_token(FLOAT);
              {if (true) return new NumericLiteral(Float.parseFloat(t.image));}
    break;
  case DOUBLE:
    t = jj_consume_token(DOUBLE);
               {if (true) return new NumericLiteral(Double.parseDouble(t.image));}
    break;
  case STRING:
    t = jj_consume_token(STRING);
              String s = unescape(t.image.substring(1, t.image.length()-1));
              {if (true) return new ObjectLiteral(s);}
    break;
  case TRUE:
    jj_consume_token(TRUE);
           {if (true) return new BooleanLiteral(true);}
    break;
  case FALSE:
    jj_consume_token(FALSE);
            {if (true) return new BooleanLiteral(false);}
    break;
  case NULL:
    jj_consume_token(NULL);
           {if (true) return new ObjectLiteral(null);}
    break;
  default:
    jj_la1[15] = jj_gen;
    jj_consume_token(-1);
    throw new ParseException();
  }
  throw new Error("Missing return statement in function");
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:44,代码来源:ExpressionParser.java

示例9: getDistributions

import prefuse.data.expression.NumericLiteral; //导入依赖的package包/类
protected double[][] getDistributions() {
	int level0,level1;
	if (m_dist_separation) {
		level0 = Math.max(0,m_separation_level-1);
		level1 = m_tree.getMaxDepth();
	} else {
		level0 = m_tree.getMaxDepth();    		
		level1 = m_tree.getMaxDepth();    		
	}
    TupleSet ts = m_vis.getVisualGroup(m_group);
    Predicate prednan = new NotPredicate(new IsNanPredicate(new ColumnExpression(m_dataField)));        
    Predicate pred0 = new AndPredicate(prednan,  
    	new ComparisonPredicate(ComparisonPredicate.LTEQ, new ColumnExpression( ParentChildNode.DEPTH ), new NumericLiteral(level0)));
    //DataHelper.printTable(System.out, (Table)ts);
    TupleSet ts0 = new CascadedTable((Table)ts, pred0);  
    Predicate pred1 = new AndPredicate(prednan,
    	new ComparisonPredicate(ComparisonPredicate.LTEQ, new ColumnExpression( ParentChildNode.DEPTH ), new NumericLiteral(level1)));
    TupleSet ts1 = new CascadedTable((Table)ts, pred1);
    double[][] result = new double[2][];

    if ( m_type == Constants.NUMERICAL ) {
        m_omaps = null;
        if ( m_scale == Constants.QUANTILE_SCALE && m_bins > 0 ) {
            double[] values0 = DataLib.toDoubleArray(ts0.tuples(), m_dataField);               
            double[] values1 = DataLib.toDoubleArray(ts1.tuples(), m_dataField);               
            result[0] = MathLib.quantiles(m_bins, values0);
            result[1] = MathLib.quantiles(m_bins, values1);
            return result;
        } else {
            double[][] dist = new double[2][2];
            dist[0][0] = DataLib.min(ts0, m_dataField).getDouble(m_dataField);
            dist[0][1] = DataLib.max(ts0, m_dataField).getDouble(m_dataField);
            dist[1][0] = DataLib.min(ts1, m_dataField).getDouble(m_dataField);
            dist[1][1] = DataLib.max(ts1, m_dataField).getDouble(m_dataField);
            return dist;
        }
    } else {
        if ( m_olist == null ) { 
            m_omaps = new Map[2];
            m_omaps[0] = DataLib.ordinalMap(ts0, m_dataField);
            m_omaps[1] = DataLib.ordinalMap(ts1, m_dataField);
        }
        return new double[][] { { 0, m_omaps[0].size()-1 },{ 0, m_omaps[1].size()-1 } };
    }
}
 
开发者ID:ieg-vienna,项目名称:TimeBench,代码行数:46,代码来源:OverlayDataColorAction.java

示例10: nodesAtDepth

import prefuse.data.expression.NumericLiteral; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
public Iterator nodesAtDepth(int depth) {
    super.index(FIELD_DEPTH);
    return super.tuples(new ComparisonPredicate(ComparisonPredicate.EQ,
            new ColumnExpression(FIELD_DEPTH), new NumericLiteral(depth)));
}
 
开发者ID:ieg-vienna,项目名称:ieg-prefuse,代码行数:7,代码来源:LinkedTree.java


注:本文中的prefuse.data.expression.NumericLiteral类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。