ImportRecord.java revision 23cb1d1297a0807fe827a38a17c54bfe1fd05e2d
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at legal-notices/CDDLv1_0.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
* Copyright 2015 ForgeRock AS
*/
/**
* Record for import composed of a byte sequence key and an indexID.
*/
{
/**
* The record overhead. In addition to entryID, key length and key bytes, the record overhead
*/
{
}
{
}
{
}
{
}
{
int answer = 0;
for (int i = 0; i < INT_SIZE; i++)
{
answer <<= 8;
answer |= (b & 0xff);
}
return answer;
}
private final ByteSequence key;
/**
* The indexID, computed by calling {@link System#identityHashCode(Object)}
* on the in-memory {@link Index} object.
*/
private final int indexID;
{
}
public int getIndexID()
{
return indexID;
}
public ByteSequence getKey()
{
return key;
}
public int compareTo(ImportRecord o)
{
if (o == null)
{
return -1;
}
if (cmp == 0)
{
return indexID - o.getIndexID();
}
return cmp;
}
{
if (this == o)
{
return true;
}
if (o instanceof ImportRecord)
{
}
return false;
}
public int hashCode()
{
final int prime = 31;
int result = 1;
return result;
}
/** {@inheritDoc} */
{
}
}