org.modeshape.jcr.query

## Class Tuples

- java.lang.Object
- - org.modeshape.jcr.query.Tuples

-     public class Tuples
      extends Object

  A simple set of classes for working with tuples of data.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `Tuples.Tuple2<T1,T2>`
    `static class` | `Tuples.Tuple2Serializer<T1,T2>`
    `protected static class` | `Tuples.Tuple2TypeFactory<T1,T2>`
    `static class` | `Tuples.Tuple3<T1,T2,T3>`
    `static class` | `Tuples.Tuple3Serializer<T1,T2,T3>`
    `protected static class` | `Tuples.Tuple3TypeFactory<T1,T2,T3>`
    `static class` | `Tuples.Tuple4<T1,T2,T3,T4>`
    `static class` | `Tuples.Tuple4Serializer<T1,T2,T3,T4>`
    `protected static class` | `Tuples.Tuple4TypeFactory<T1,T2,T3,T4>`
    `static interface` | `Tuples.TupleFactory<T>`
    `static class` | `Tuples.TupleN`
    `static class` | `Tuples.TupleNSerializer`
    `protected static class` | `Tuples.TupleNTypeFactory`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected static int` | `compareValues(Object value1, Object value2)`
    `static org.mapdb.Serializer<Tuples.TupleN>` | `serializer(org.mapdb.Serializer<?>[] serializers)` Create a `Serializer` for n-ary tuples
    `static org.mapdb.Serializer<?>` | `serializer(org.mapdb.Serializer<?> serializer, int tupleSize)` Create a `Serializer` for uniform tuples.
    `static <T1,T2> org.mapdb.Serializer<Tuples.Tuple2<T1,T2>>` | `serializer(org.mapdb.Serializer<T1> first, org.mapdb.Serializer<T2> second)` Create a `Serializer` for tuples of size 2.
    `static <T1,T2,T3> org.mapdb.Serializer<Tuples.Tuple3<T1,T2,T3>>` | `serializer(org.mapdb.Serializer<T1> first, org.mapdb.Serializer<T2> second, org.mapdb.Serializer<T3> third)` Create a `Serializer` for tuples of size 3.
    `static <T1,T2,T3,T4> org.mapdb.Serializer<Tuples.Tuple4<T1,T2,T3,T4>>` | `serializer(org.mapdb.Serializer<T1> first, org.mapdb.Serializer<T2> second, org.mapdb.Serializer<T3> third, org.mapdb.Serializer<T4> fourth)` Create a `Serializer` for tuples of size 4.
    `static Tuples.TupleN` | `tuple(Object[] values)` Create a tuple with the given values.
    `static <T1,T2> Tuples.Tuple2<T1,T2>` | `tuple(T1 v1, T2 v2)` Create a tuple with the given two values.
    `static <T1,T2,T3> Tuples.Tuple3<T1,T2,T3>` | `tuple(T1 v1, T2 v2, T3 v3)` Create a tuple with the given three values.
    `static <T1,T2,T3,T4> Tuples.Tuple4<T1,T2,T3,T4>` | `tuple(T1 v1, T2 v2, T3 v3, T4 v4)` Create a tuple with the given four values.
    `static TypeSystem.TypeFactory<?>` | `typeFactory(Collection<TypeSystem.TypeFactory<?>> types)` Create a type factory for n-ary tuples.
    `static TypeSystem.TypeFactory<?>` | `typeFactory(TypeSystem.TypeFactory<?> type, int tupleSize)` Create a type factory for uniform tuples.
    `static <T1,T2> TypeSystem.TypeFactory<Tuples.Tuple2<T1,T2>>` | `typeFactory(TypeSystem.TypeFactory<T1> type1, TypeSystem.TypeFactory<T2> type2)` Create a type factory for tuples of size 2.
    `static <T1,T2,T3> TypeSystem.TypeFactory<Tuples.Tuple3<T1,T2,T3>>` | `typeFactory(TypeSystem.TypeFactory<T1> type1, TypeSystem.TypeFactory<T2> type2, TypeSystem.TypeFactory<T3> type3)` Create a type factory for tuples of size 3.
    `static <T1,T2,T3,T4> TypeSystem.TypeFactory<Tuples.Tuple4<T1,T2,T3,T4>>` | `typeFactory(TypeSystem.TypeFactory<T1> type1, TypeSystem.TypeFactory<T2> type2, TypeSystem.TypeFactory<T3> type3, TypeSystem.TypeFactory<T4> type4)` Create a type factory for tuples of size 4.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### tuple

          public static <T1,T2> Tuples.Tuple2<T1,T2> tuple(T1 v1,
                                           T2 v2)

      Create a tuple with the given two values.
      Parameters:
        `v1` - the first value
        `v2` - the second value
      Returns:
        the tuple; never null

    - #### tuple

          public static <T1,T2,T3> Tuples.Tuple3<T1,T2,T3> tuple(T1 v1,
                                                 T2 v2,
                                                 T3 v3)

      Create a tuple with the given three values.
      Parameters:
        `v1` - the first value
        `v2` - the second value
        `v3` - the third value
      Returns:
        the tuple; never null

    - #### tuple

          public static <T1,T2,T3,T4> Tuples.Tuple4<T1,T2,T3,T4> tuple(T1 v1,
                                                       T2 v2,
                                                       T3 v3,
                                                       T4 v4)

      Create a tuple with the given four values.
      Parameters:
        `v1` - the first value
        `v2` - the second value
        `v3` - the third value
        `v4` - the fourth value
      Returns:
        the tuple; never null

    - #### tuple

          public static Tuples.TupleN tuple(Object[] values)

      Create a tuple with the given values. Note that this always creates a n-ary tuple, so use `tuple(Object, Object)`, `tuple(Object, Object, Object)` or `tuple(Object, Object, Object, Object)` for tuples smaller than 5.
      Parameters:
        `values` - the values
      Returns:
        the tuple; never null

    - #### typeFactory

          public static <T1,T2> TypeSystem.TypeFactory<Tuples.Tuple2<T1,T2>> typeFactory(TypeSystem.TypeFactory<T1> type1,
                                                                         TypeSystem.TypeFactory<T2> type2)

      Create a type factory for tuples of size 2.
      Parameters:
        `type1` - the first type; may not be null
        `type2` - the second type; may not be null
      Returns:
        the type factory; never null

    - #### typeFactory

          public static <T1,T2,T3> TypeSystem.TypeFactory<Tuples.Tuple3<T1,T2,T3>> typeFactory(TypeSystem.TypeFactory<T1> type1,
                                                                               TypeSystem.TypeFactory<T2> type2,
                                                                               TypeSystem.TypeFactory<T3> type3)

      Create a type factory for tuples of size 3.
      Parameters:
        `type1` - the first type; may not be null
        `type2` - the second type; may not be null
        `type3` - the third type; may not be null
      Returns:
        the type factory; never null

    - #### typeFactory

          public static <T1,T2,T3,T4> TypeSystem.TypeFactory<Tuples.Tuple4<T1,T2,T3,T4>> typeFactory(TypeSystem.TypeFactory<T1> type1,
                                                                                     TypeSystem.TypeFactory<T2> type2,
                                                                                     TypeSystem.TypeFactory<T3> type3,
                                                                                     TypeSystem.TypeFactory<T4> type4)

      Create a type factory for tuples of size 4.
      Parameters:
        `type1` - the first type; may not be null
        `type2` - the second type; may not be null
        `type3` - the third type; may not be null
        `type4` - the fourth type; may not be null
      Returns:
        the type factory; never null

    - #### typeFactory

          public static TypeSystem.TypeFactory<?> typeFactory(Collection<TypeSystem.TypeFactory<?>> types)

      Create a type factory for n-ary tuples.
      Parameters:
        `types` - the collection of types for each slot in the tuple
      Returns:
        the type factory; never null

    - #### typeFactory

          public static TypeSystem.TypeFactory<?> typeFactory(TypeSystem.TypeFactory<?> type,
                                              int tupleSize)

      Create a type factory for uniform tuples.
      Parameters:
        `type` - the type of each/every slot in the tuples
        `tupleSize` - the size of the tuples
      Returns:
        the type factory; never null

    - #### serializer

          public static <T1,T2> org.mapdb.Serializer<Tuples.Tuple2<T1,T2>> serializer(org.mapdb.Serializer<T1> first,
                                                                      org.mapdb.Serializer<T2> second)

      Create a `Serializer` for tuples of size 2.
      Parameters:
        `first` - the serializer for the first slot
        `second` - the serializer for the second slot
      Returns:
        the serializer; never null

    - #### serializer

          public static <T1,T2,T3> org.mapdb.Serializer<Tuples.Tuple3<T1,T2,T3>> serializer(org.mapdb.Serializer<T1> first,
                                                                            org.mapdb.Serializer<T2> second,
                                                                            org.mapdb.Serializer<T3> third)

      Create a `Serializer` for tuples of size 3.
      Parameters:
        `first` - the serializer for the first slot
        `second` - the serializer for the second slot
        `third` - the serializer for the third slot
      Returns:
        the serializer; never null

    - #### serializer

          public static <T1,T2,T3,T4> org.mapdb.Serializer<Tuples.Tuple4<T1,T2,T3,T4>> serializer(org.mapdb.Serializer<T1> first,
                                                                                  org.mapdb.Serializer<T2> second,
                                                                                  org.mapdb.Serializer<T3> third,
                                                                                  org.mapdb.Serializer<T4> fourth)

      Create a `Serializer` for tuples of size 4.
      Parameters:
        `first` - the serializer for the first slot
        `second` - the serializer for the second slot
        `third` - the serializer for the third slot
        `fourth` - the serializer for the fourth slot
      Returns:
        the serializer; never null

    - #### serializer

          public static org.mapdb.Serializer<Tuples.TupleN> serializer(org.mapdb.Serializer<?>[] serializers)

      Create a `Serializer` for n-ary tuples
      Parameters:
        `serializers` - the serializers for each slot in the tuples
      Returns:
        the serializer; never null

    - #### serializer

          public static org.mapdb.Serializer<?> serializer(org.mapdb.Serializer<?> serializer,
                                           int tupleSize)

      Create a `Serializer` for uniform tuples.
      Parameters:
        `serializer` - the serializer of each/every slot in the tuples
        `tupleSize` - the size of the tuples
      Returns:
        the type factory; never null

    - #### compareValues

          protected static int compareValues(Object value1,
                          Object value2)

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.