Package com.ibm.icu.impl
Class SortedSetRelation
- java.lang.Object
-
- com.ibm.icu.impl.SortedSetRelation
-
public class SortedSetRelation extends Object
Computationally efficient determination of the relationship between two SortedSets.
-
-
Field Summary
Fields Modifier and Type Field Description static intAThere are 8 combinations of the relationship bits.static intA_AND_BThe relationship between two sets A and B can be determined by looking at: A - B A & B (intersection) B - A These are represented by a set of bits.static intA_NOT_BThe relationship between two sets A and B can be determined by looking at: A - B A & B (intersection) B - A These are represented by a set of bits.static intADDALLThere are 8 combinations of the relationship bits.static intANYThere are 8 combinations of the relationship bits.static intBThere are 8 combinations of the relationship bits.static intB_NOT_AThe relationship between two sets A and B can be determined by looking at: A - B A & B (intersection) B - A These are represented by a set of bits.static intB_REMOVEALLThere are 8 combinations of the relationship bits.static intCOMPLEMENTALLThere are 8 combinations of the relationship bits.static intCONTAINSThere are 8 combinations of the relationship bits.static intDISJOINTThere are 8 combinations of the relationship bits.static intEQUALSThere are 8 combinations of the relationship bits.static intISCONTAINEDThere are 8 combinations of the relationship bits.static intNO_AThere are 8 combinations of the relationship bits.static intNO_BThere are 8 combinations of the relationship bits.static intNONEThere are 8 combinations of the relationship bits.static intREMOVEALLThere are 8 combinations of the relationship bits.static intRETAINALLThere are 8 combinations of the relationship bits.
-
Constructor Summary
Constructors Constructor Description SortedSetRelation()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends Object & Comparable<? super T>>
SortedSet<? extends T>doOperation(SortedSet<T> a, int relation, SortedSet<T> b)Utility that could be on SortedSet.static <T extends Object & Comparable<? super T>>
booleanhasRelation(SortedSet<T> a, int allow, SortedSet<T> b)Utility that could be on SortedSet.
-
-
-
Field Detail
-
A_NOT_B
public static final int A_NOT_B
The relationship between two sets A and B can be determined by looking at: A - B A & B (intersection) B - A These are represented by a set of bits. Bit 2 is true if A - B is not empty Bit 1 is true if A & B is not empty BIT 0 is true if B - A is not empty- See Also:
- Constant Field Values
-
A_AND_B
public static final int A_AND_B
The relationship between two sets A and B can be determined by looking at: A - B A & B (intersection) B - A These are represented by a set of bits. Bit 2 is true if A - B is not empty Bit 1 is true if A & B is not empty BIT 0 is true if B - A is not empty- See Also:
- Constant Field Values
-
B_NOT_A
public static final int B_NOT_A
The relationship between two sets A and B can be determined by looking at: A - B A & B (intersection) B - A These are represented by a set of bits. Bit 2 is true if A - B is not empty Bit 1 is true if A & B is not empty BIT 0 is true if B - A is not empty- See Also:
- Constant Field Values
-
ANY
public static final int ANY
There are 8 combinations of the relationship bits. These correspond to the filters (combinations of allowed bits) in hasRelation. They also correspond to the modification functions, listed in comments.- See Also:
- Constant Field Values
-
CONTAINS
public static final int CONTAINS
There are 8 combinations of the relationship bits. These correspond to the filters (combinations of allowed bits) in hasRelation. They also correspond to the modification functions, listed in comments.- See Also:
- Constant Field Values
-
DISJOINT
public static final int DISJOINT
There are 8 combinations of the relationship bits. These correspond to the filters (combinations of allowed bits) in hasRelation. They also correspond to the modification functions, listed in comments.- See Also:
- Constant Field Values
-
ISCONTAINED
public static final int ISCONTAINED
There are 8 combinations of the relationship bits. These correspond to the filters (combinations of allowed bits) in hasRelation. They also correspond to the modification functions, listed in comments.- See Also:
- Constant Field Values
-
NO_B
public static final int NO_B
There are 8 combinations of the relationship bits. These correspond to the filters (combinations of allowed bits) in hasRelation. They also correspond to the modification functions, listed in comments.- See Also:
- Constant Field Values
-
EQUALS
public static final int EQUALS
There are 8 combinations of the relationship bits. These correspond to the filters (combinations of allowed bits) in hasRelation. They also correspond to the modification functions, listed in comments.- See Also:
- Constant Field Values
-
NO_A
public static final int NO_A
There are 8 combinations of the relationship bits. These correspond to the filters (combinations of allowed bits) in hasRelation. They also correspond to the modification functions, listed in comments.- See Also:
- Constant Field Values
-
NONE
public static final int NONE
There are 8 combinations of the relationship bits. These correspond to the filters (combinations of allowed bits) in hasRelation. They also correspond to the modification functions, listed in comments.- See Also:
- Constant Field Values
-
ADDALL
public static final int ADDALL
There are 8 combinations of the relationship bits. These correspond to the filters (combinations of allowed bits) in hasRelation. They also correspond to the modification functions, listed in comments.- See Also:
- Constant Field Values
-
A
public static final int A
There are 8 combinations of the relationship bits. These correspond to the filters (combinations of allowed bits) in hasRelation. They also correspond to the modification functions, listed in comments.- See Also:
- Constant Field Values
-
COMPLEMENTALL
public static final int COMPLEMENTALL
There are 8 combinations of the relationship bits. These correspond to the filters (combinations of allowed bits) in hasRelation. They also correspond to the modification functions, listed in comments.- See Also:
- Constant Field Values
-
B
public static final int B
There are 8 combinations of the relationship bits. These correspond to the filters (combinations of allowed bits) in hasRelation. They also correspond to the modification functions, listed in comments.- See Also:
- Constant Field Values
-
REMOVEALL
public static final int REMOVEALL
There are 8 combinations of the relationship bits. These correspond to the filters (combinations of allowed bits) in hasRelation. They also correspond to the modification functions, listed in comments.- See Also:
- Constant Field Values
-
RETAINALL
public static final int RETAINALL
There are 8 combinations of the relationship bits. These correspond to the filters (combinations of allowed bits) in hasRelation. They also correspond to the modification functions, listed in comments.- See Also:
- Constant Field Values
-
B_REMOVEALL
public static final int B_REMOVEALL
There are 8 combinations of the relationship bits. These correspond to the filters (combinations of allowed bits) in hasRelation. They also correspond to the modification functions, listed in comments.- See Also:
- Constant Field Values
-
-
Method Detail
-
hasRelation
public static <T extends Object & Comparable<? super T>> boolean hasRelation(SortedSet<T> a, int allow, SortedSet<T> b)
Utility that could be on SortedSet. Faster implementation than what is in Java for doing contains, equals, etc.- Parameters:
a- first setallow- filter, using ANY, CONTAINS, etc.b- second set- Returns:
- whether the filter relationship is true or not.
-
doOperation
public static <T extends Object & Comparable<? super T>> SortedSet<? extends T> doOperation(SortedSet<T> a, int relation, SortedSet<T> b)
Utility that could be on SortedSet. Allows faster implementation than what is in Java for doing addAll, removeAll, retainAll, (complementAll).- Parameters:
a- first setrelation- the relation filter, using ANY, CONTAINS, etc.b- second set- Returns:
- the new set
-
-