~ubuntu-branches/ubuntu/natty/electric/natty

« back to all changes in this revision

Viewing changes to com/sun/electric/database/geometry/btree/unboxed/UnboxedPair.java

  • Committer: Bazaar Package Importer
  • Author(s): Onkar Shinde
  • Date: 2010-01-09 16:26:04 UTC
  • mfrom: (1.1.4 upstream) (3.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100109162604-1ypvmy8ijmlc6oq7
Tags: 8.10-1
* New upstream version.
* debian/control
  - Add libjava3d-java and quilt build dependencies.
  - Update standards version to 3.8.3.
  - Add libjava3d-java as recommends to binary package.
* debian/rules
  - Use quilt patch system instead of simple patchsys.
  - Add java3d related jar files to DEB_JARS.
* debian/patches/*
  - Update as per current upstream source. Convert to quilt.
* debian/ant.properties
  - Do not disable 3D plugin anymore.
  - Use new property to disable compilation of OS X related classes.
* debian/wrappers/electric
  - Add java3d related jar files to runtime classpath.
* debian/README.source
  - Change text to the appropriate one for quilt.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- tab-width: 4 -*-
 
2
 *
 
3
 * Electric(tm) VLSI Design System
 
4
 *
 
5
 * File: BTree.java
 
6
 *
 
7
 * Copyright (c) 2009 Sun Microsystems and Static Free Software
 
8
 *
 
9
 * Electric(tm) is free software; you can redistribute it and/or modify
 
10
 * it under the terms of the GNU Lesser General Public License as published by
 
11
 * the Free Software Foundation; either version 3 of the License, or
 
12
 * (at your option) any later version.
 
13
 *
 
14
 * Electric(tm) is distributed in the hope that it will be useful,
 
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
17
 * GNU Lesser General Public License for more details.
 
18
 *
 
19
 * You should have received a copy of the GNU Lesser General Public License
 
20
 * along with Electric(tm); see the file COPYING.  If not, write to
 
21
 * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
 
22
 * Boston, Mass 02111-1307, USA.
 
23
 */
 
24
package com.sun.electric.database.geometry.btree.unboxed;
 
25
 
 
26
import java.io.*;
 
27
import java.util.*;
 
28
 
 
29
/** an implementation of Pair<A,B> in unboxed form */
 
30
public class UnboxedPair<A extends Serializable,B extends Serializable>
 
31
    implements Unboxed<Pair<A,B>> {
 
32
 
 
33
    private final Unboxed<A> ua;
 
34
    private final Unboxed<B> ub;
 
35
    public UnboxedPair(Unboxed<A> ua, Unboxed<B> ub) { this.ua = ua; this.ub = ub; }
 
36
    public int getSize() { return ua.getSize()+ub.getSize(); }
 
37
    public Pair<A,B> deserialize(byte[] buf, int ofs) {
 
38
        A a = ua.deserialize(buf, ofs);
 
39
        B b = ub.deserialize(buf, ofs+ua.getSize());
 
40
        return new Pair<A,B>(a,b);
 
41
    }
 
42
    public void serialize(Pair<A,B> sme, byte[] buf, int ofs) {
 
43
        ua.serialize(sme.getKey(), buf, ofs);
 
44
        ub.serialize(sme.getValue(), buf, ofs+ua.getSize());
 
45
    }
 
46
}