diva.sketch.parser2d
Class AreaRatioRelation

java.lang.Object
  extended by diva.sketch.parser2d.AreaRatioRelation
All Implemented Interfaces:
Relation

public class AreaRatioRelation
extends Object
implements Relation

Calculate the ratio of areas of the input scene elements.

Version:
$Revision: 1.7 $
Author:
Michael Shilman (michaels@eecs.berkeley.edu)

Field Summary
static String NAME
          The name that this relation goes by in text form.
 
Constructor Summary
AreaRatioRelation()
           
 
Method Summary
 double apply(SceneElement e1, SceneElement e2)
          Calculate the ratio of the area of e1 over the area of e2.
 String getName()
          The name of this relation.
 String toString()
          Print out the contents of this relation.
 String toString(String e1Name, String e2Name)
          Pretty print the relation in the grammar format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NAME

public static String NAME
The name that this relation goes by in text form.

Constructor Detail

AreaRatioRelation

public AreaRatioRelation()
Method Detail

apply

public double apply(SceneElement e1,
                    SceneElement e2)
Calculate the ratio of the area of e1 over the area of e2.

Specified by:
apply in interface Relation

getName

public String getName()
The name of this relation.

Specified by:
getName in interface Relation

toString

public String toString(String e1Name,
                       String e2Name)
Pretty print the relation in the grammar format.

Specified by:
toString in interface Relation

toString

public String toString()
Print out the contents of this relation.

Overrides:
toString in class Object


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.