KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > soot > jimple > spark > sets > EmptyPointsToSet


1 /* Soot - a J*va Optimization Framework
2  * Copyright (C) 2002 Ondrej Lhotak
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */

19
20 package soot.jimple.spark.sets;
21 import soot.*;
22 import soot.jimple.spark.*;
23 import soot.jimple.spark.pag.Node;
24 import java.util.*;
25
26 /** Implementation of an empty, immutable points-to set.
27  * @author Ondrej Lhotak
28  */

29 public class EmptyPointsToSet extends PointsToSetInternal {
30     public EmptyPointsToSet( Singletons.Global g ) { super(null); }
31     public static EmptyPointsToSet v() { return G.v().soot_jimple_spark_sets_EmptyPointsToSet(); }
32
33     /** Returns true if this set contains no run-time objects. */
34     public boolean isEmpty() { return true; }
35     /** Returns true if this set shares some objects with other. */
36     public boolean hasNonEmptyIntersection( PointsToSet other ) {
37         return false;
38     }
39     /** Set of all possible run-time types of objects in the set. */
40     public Set possibleTypes() { return Collections.EMPTY_SET; }
41     /** Adds contents of other into this set, returns true if this set
42      * changed. */

43     public boolean addAll( PointsToSetInternal other,
44             PointsToSetInternal exclude ) {
45         throw new RuntimeException JavaDoc( "can't add into empty immutable set" );
46     }
47     /** Calls v's visit method on all nodes in this set. */
48     public boolean forall( P2SetVisitor v ) {
49         return false;
50     }
51     /** Adds n to this set, returns true if n was not already in this set. */
52     public boolean add( Node n ) {
53         throw new RuntimeException JavaDoc( "can't add into empty immutable set" );
54     }
55     /** Returns true iff the set contains n. */
56     public boolean contains( Node n ) {
57         return false;
58     }
59
60     public Set possibleStringConstants() { return Collections.EMPTY_SET; }
61     public Set possibleClassConstants() { return Collections.EMPTY_SET; }
62
63 }
64
65
Popular Tags