Ejemplo n.º 1
0
 /**
  * Creates a new <code>BitVectorDto</code> object that posesses the same characteristics as a
  * given <code>BitVector</code>.
  *
  * @param id the internal id to give to this BitVectorDto object.
  * @param v the <code>BitVector</code> from which data will be obtained.
  * @return a <code>BitVectorDto</code> based on the information (size, bits) found in the <code>
  *     BitVector</code> <b>v</b>.
  */
 public static BitVectorDto toDto(long id, BitVector v) {
   BitVectorDto d = new BitVectorDto();
   d.setId(id);
   d.setSize(v.size());
   d.setBits(v.getBits());
   return d;
 }
Ejemplo n.º 2
0
 /**
  * Creates a new <code>BitVector</code> object that posesses the same characteristics as a given
  * <code>BitVectorDto</code>.
  *
  * @param d the <code>BitVectorDto</code> from which data will be obtained.
  * @return a <code>BitVector</code> based on the information (size, bits) found in the <code>
  *     BitVectorDto</code> <b>d</b>.
  */
 public static BitVector toVector(BitVectorDto d) {
   if (d == null) {
     throw new NullPointerException("dto cannot be null");
   }
   return new BitVector(d.getSize(), d.getBits());
 }