mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Rejiggered ChildEntry and its mapping, for considerably better performance. Actually
it was kind of a Doh! moment. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@4336 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
116
source/java/org/alfresco/repo/avm/ChildKey.java
Normal file
116
source/java/org/alfresco/repo/avm/ChildKey.java
Normal file
@@ -0,0 +1,116 @@
|
||||
/*
|
||||
* Copyright (C) 2006 Alfresco, Inc.
|
||||
*
|
||||
* Licensed under the Mozilla Public License version 1.1
|
||||
* with a permitted attribution clause. You may obtain a
|
||||
* copy of the License at
|
||||
*
|
||||
* http://www.alfresco.org/legal/license.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific
|
||||
* language governing permissions and limitations under the
|
||||
* License.
|
||||
*/
|
||||
package org.alfresco.repo.avm;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* The key to a ChildEntry, a Parent and a name.
|
||||
* @author britt
|
||||
*/
|
||||
public class ChildKey implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 2033634095972856432L;
|
||||
|
||||
/**
|
||||
* The Parent.
|
||||
*/
|
||||
private DirectoryNode fParent;
|
||||
|
||||
/**
|
||||
* The child's name.
|
||||
*/
|
||||
private String fName;
|
||||
|
||||
/**
|
||||
* Construct one with parameters.
|
||||
* @param parent The parent directory.
|
||||
* @param name The name of the child.
|
||||
*/
|
||||
public ChildKey(DirectoryNode parent, String name)
|
||||
{
|
||||
fParent = parent;
|
||||
fName = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* A Default Constructor.
|
||||
*/
|
||||
public ChildKey()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the parent.
|
||||
*/
|
||||
public void setParent(DirectoryNode parent)
|
||||
{
|
||||
fParent = parent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the parent.
|
||||
* @return A DirectoryNode.
|
||||
*/
|
||||
public DirectoryNode getParent()
|
||||
{
|
||||
return fParent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the name.
|
||||
*/
|
||||
public void setName(String name)
|
||||
{
|
||||
fName = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the name.
|
||||
*/
|
||||
public String getName()
|
||||
{
|
||||
return fName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Override of equals.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object other)
|
||||
{
|
||||
if (this == other)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof ChildKey))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
ChildKey o = (ChildKey)other;
|
||||
return fParent.equals(o.getParent()) &&
|
||||
fName.equals(o.getName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Override of hashCode.
|
||||
*/
|
||||
public int hashCode()
|
||||
{
|
||||
return fParent.hashCode() + fName.hashCode();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user