Top Description Inners Constructors Methods
org.aspectj.util

public Class PartialOrder

extends Object
Class Inheritance
Imports
java.util.ArrayList, .Iterator, .LinkedList, .List

This class implements a partial order It includes routines for doing a topo-sort

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
PartialOrder.PartialComparable

All classes that want to be part of a partial order must implement PartialOrder.PartialComparable.

private static class
pack-priv static class
PartialOrder.Token

/* a minimal testing harness

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static <T extends PartialOrder.PartialComparable> void
public static void
main(String[] args)

private static <T extends PartialOrder.PartialComparable> void
public static <T extends PartialOrder.PartialComparable> List<T>

Returns:

the same members as objects, but sorted according to their partial order. returns null if the objects are cyclical
sort
(List<T>
must all implement PartialComparable
objects
)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

PartialOrderback to summary
public PartialOrder()

Method Detail

addNewPartialComparableback to summary
private static <T extends PartialOrder.PartialComparable> void addNewPartialComparable(List<PartialOrder.SortObject<T>> graph, T o)
mainback to summary
public static void main(String[] args)
removeFromGraphback to summary
private static <T extends PartialOrder.PartialComparable> void removeFromGraph(List<PartialOrder.SortObject<T>> graph, PartialOrder.SortObject<T> o)
sortback to summary
public static <T extends PartialOrder.PartialComparable> List<T> sort(List<T> objects)
Parameters
objects:List<T>

must all implement PartialComparable

Returns:List<T>

the same members as objects, but sorted according to their partial order. returns null if the objects are cyclical

org.aspectj.util back to summary

public Interface PartialOrder.PartialComparable

Known Direct Implementers
org.aspectj.util.PartialOrder.Token, org.aspectj.weaver.ConcreteTypeMunger, org.aspectj.weaver.ShadowMunger, org.aspectj.weaver.bcel.BcelClassWeaver.IfaceInitList

All classes that want to be part of a partial order must implement PartialOrder.PartialComparable.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

  • +1 if this is greater than other
  • -1 if this is less than other
  • 0 if this is not comparable to other

Note

returning 0 from this method doesn't mean the same thing as returning 0 from java.util.Comparable.compareTo()

compareTo
(Object other)

public int
fallbackCompareTo(Object other)

This method can provide a deterministic ordering for elements that are strictly not comparable.

Method Detail

compareToback to summary
public int compareTo(Object other)
Returns:int

  • +1 if this is greater than other
  • -1 if this is less than other
  • 0 if this is not comparable to other

Note

returning 0 from this method doesn't mean the same thing as returning 0 from java.util.Comparable.compareTo()

fallbackCompareToback to summary
public int fallbackCompareTo(Object other)

This method can provide a deterministic ordering for elements that are strictly not comparable. If you have no need for this, this method can just return 0 whenever called.

org.aspectj.util back to summary

private Class PartialOrder.SortObject<T extends PartialOrder.PartialComparable>

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv List<PartialOrder.SortObject<T>>
pack-priv T
pack-priv List<PartialOrder.SortObject<T>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv boolean
pack-priv boolean
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

biggerObjectsback to summary
pack-priv List<PartialOrder.SortObject<T>> biggerObjects
objectback to summary
pack-priv T object
smallerObjectsback to summary
pack-priv List<PartialOrder.SortObject<T>> smallerObjects

Constructor Detail

SortObjectback to summary
public SortObject(T o)

Method Detail

hasNoSmallerObjectsback to summary
pack-priv boolean hasNoSmallerObjects()
removeSmallerObjectback to summary
pack-priv boolean removeSmallerObject(PartialOrder.SortObject<T> o)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

org.aspectj.util back to summary

pack-priv Class PartialOrder.Token

extends Object
implements PartialComparable
Class Inheritance
All Implemented Interfaces
org.aspectj.util.PartialOrder.PartialComparable

/* a minimal testing harness

Field Summary

Modifier and TypeField and Description
private String
s

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public int
public int
fallbackCompareTo(Object other)

Implements org.aspectj.util.PartialOrder.PartialComparable.fallbackCompareTo.

This method can provide a deterministic ordering for elements that are strictly not comparable.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

sback to summary
private String s

Constructor Detail

Tokenback to summary
pack-priv Token(String s)

Method Detail

compareToback to summary
public int compareTo(Object other)

Implements org.aspectj.util.PartialOrder.PartialComparable.compareTo.

Returns:int

Doc from org.aspectj.util.PartialOrder.PartialComparable.compareTo.

  • +1 if this is greater than other
  • -1 if this is less than other
  • 0 if this is not comparable to other

Note

returning 0 from this method doesn't mean the same thing as returning 0 from java.util.Comparable.compareTo()

fallbackCompareToback to summary
public int fallbackCompareTo(Object other)

Implements org.aspectj.util.PartialOrder.PartialComparable.fallbackCompareTo.

Doc from org.aspectj.util.PartialOrder.PartialComparable.fallbackCompareTo.

This method can provide a deterministic ordering for elements that are strictly not comparable. If you have no need for this, this method can just return 0 whenever called.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.