org.apache.pdfbox.cos

## Class COSObjectKey

- java.lang.Object
- - org.apache.pdfbox.cos.COSObjectKey

All Implemented Interfaces:
  Comparable<COSObjectKey>

    public class COSObjectKey
    extends Object
    implements Comparable<COSObjectKey>

Object representing the physical reference to an indirect pdf object.

Author:
  Michael Traut

### Constructor Summary

Constructors
Constructor and Description
`COSObjectKey(COSObject object)` Constructor.
`COSObjectKey(long num, int gen)` Constructor.

### Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods
`int` `compareTo(COSObjectKey other)`
`boolean` `equals(Object obj)`
`void` `fixGeneration(int genNumber)` Deprecated. will be removed in the next major release
`int` `getGeneration()` This will get the object generation number.
`long` `getNumber()` This will get the object number.
`int` `hashCode()`
`String` `toString()`

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

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### COSObjectKey

    public COSObjectKey(COSObject object)

Constructor.

Parameters:
  `object` - The object that this key will represent.

#### COSObjectKey

    public COSObjectKey(long num,
                        int gen)

Constructor.

Parameters:
  `num` - The object number.
  `gen` - The object generation number.

### Method Detail

#### equals

    public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`

#### getGeneration

    public int getGeneration()

This will get the object generation number.

Returns:
  The object generation number.

#### fixGeneration

    public void fixGeneration(int genNumber)

Deprecated. will be removed in the next major release
This will set the generation number. It is intended for fixes only.

Parameters:
  `genNumber` - the new generation number.

#### getNumber

    public long getNumber()

This will get the object number.

Returns:
  The object number.

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

#### compareTo

    public int compareTo(COSObjectKey other)

Specified by:
  `compareTo` in interface `Comparable<COSObjectKey>`