Package daikon
Class PptMap
- Object
-
- PptMap
-
- All Implemented Interfaces:
Serializable
public class PptMap extends Object implements Serializable
Maps from a program point name (a String) to a PptTopLevel.This is the major data structure of Daikon. All the invariants can be found in it, and an
.inv
file contains (only) the serialized form of this object.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PptMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(PptTopLevel ppt)
void
addAll(List<PptTopLevel> ppts)
Collection<PptTopLevel>
all_ppts()
Returns all of the program points in the map.Collection<PptTopLevel>
asCollection()
Returns unstably-ordered collection of PptTopLevels.boolean
containsName(String name)
Returns whether or not 'name' is the name of a Ppt in the map.int
countSlices()
Return the number of active PptSlices.@Nullable PptTopLevel
get(PptName name)
Get the pptname 'name' from the map.@Nullable PptTopLevel
get(String name)
Get the pptname named 'name' from the map.Collection<@KeyFor("nameToPpt") String>
nameStringSet()
Returns an unmodifiable version of the keySet.Iterable<PptTopLevel>
ppt_all_iterable()
Returns an iterable over the PptTopLevels in this, sorted by Ppt.NameComparator on their names.Iterator<PptTopLevel>
ppt_all_iterator()
Returns an iterator over the PptTopLevels in this, sorted by Ppt.NameComparator on their names.Iterable<PptTopLevel>
pptIterable()
Returns an iterable over the PptTopLevels in this, sorted by Ppt.NameComparator on their names.Iterator<PptTopLevel>
pptIterator()
Returns an iterator over the PptTopLevels in this, sorted by Ppt.NameComparator on their names.void
removeUnsampled()
Blow away any PptTopLevels that never saw any samples (to reclaim space).void
repCheck()
Check the rep invariant of this.int
size()
String
toString()
void
trimToSize()
Iterate over the PptTopLevels and trim them.
-
-
-
Constructor Detail
-
PptMap
public PptMap()
-
-
Method Detail
-
add
public void add(PptTopLevel ppt)
-
addAll
public void addAll(List<PptTopLevel> ppts)
-
get
@Pure public @Nullable PptTopLevel get(String name)
Get the pptname named 'name' from the map. Note that conditional program points are not stored in the map by name. They are only available through their parent.
-
get
@Pure public @Nullable PptTopLevel get(PptName name)
Get the pptname 'name' from the map. Note that conditional program points are not stored in the map by name. They are only available through their parent.
-
containsName
@Pure @EnsuresNonNullIf(result=true, expression="get(#1)") public boolean containsName(String name)
Returns whether or not 'name' is the name of a Ppt in the map. Note that conditional program points are not stored in the map by name. They are only available through their parent.
-
all_ppts
public Collection<PptTopLevel> all_ppts()
Returns all of the program points in the map.
-
asCollection
public Collection<PptTopLevel> asCollection()
Returns unstably-ordered collection of PptTopLevels.- Returns:
- unstably-ordered collection of PptTopLevels
- See Also:
pptIterator()
-
nameStringSet
public Collection<@KeyFor("nameToPpt") String> nameStringSet()
Returns an unmodifiable version of the keySet.- Returns:
- an unmodifiable version of the keySet
-
pptIterator
public Iterator<PptTopLevel> pptIterator()
Returns an iterator over the PptTopLevels in this, sorted by Ppt.NameComparator on their names. The sorting makes the iterator deterministic.If you wish to merely iterate over the result in a foreach loop, use
pptIterable()
instead.- Returns:
- an iterator over the PptTopLevels in this, sorted by Ppt.NameComparator on their names
- See Also:
pptIterable()
-
pptIterable
public Iterable<PptTopLevel> pptIterable()
Returns an iterable over the PptTopLevels in this, sorted by Ppt.NameComparator on their names. The sorting makes the iterator deterministic.It is a wrapper around
pptIterator()
that can be used in a foreach loop.- Returns:
- an iterable over the PptTopLevels in this, sorted by Ppt.NameComparator on their names
- See Also:
pptIterator()
-
ppt_all_iterator
public Iterator<PptTopLevel> ppt_all_iterator()
Returns an iterator over the PptTopLevels in this, sorted by Ppt.NameComparator on their names. This differs from pptIterator() in that it includes all ppts (including conditional ppts).If you wish to merely iterate over the result in a Java new-style for loop ("foreach loop"), use
ppt_all_iterable()
instead.- Returns:
- an iterator over the PptTopLevels in this, sorted by Ppt.NameComparator on their names
- See Also:
ppt_all_iterable()
-
ppt_all_iterable
public Iterable<PptTopLevel> ppt_all_iterable()
Returns an iterable over the PptTopLevels in this, sorted by Ppt.NameComparator on their names. This differs from pptIterable() in that it includes all ppts (including conditional ppts).It is a wrapper around
ppt_all_iterator()
that can be used in a Java new-style for loop ("foreach loop").- Returns:
- an iterable over the PptTopLevels in this, sorted by Ppt.NameComparator on their names
- See Also:
ppt_all_iterator()
-
trimToSize
public void trimToSize()
Iterate over the PptTopLevels and trim them.
-
repCheck
public void repCheck()
Check the rep invariant of this. Throws an Error if incorrect.
-
countSlices
@Pure public int countSlices()
Return the number of active PptSlices.
-
size
@Pure public int size()
-
removeUnsampled
public void removeUnsampled()
Blow away any PptTopLevels that never saw any samples (to reclaim space).
-
-