com.mucommander.file
Class ArchiveEntryTree

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by com.mucommander.file.ArchiveEntryTree
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode

public class ArchiveEntryTree
extends javax.swing.tree.DefaultMutableTreeNode

Stores archive entries and organizes them in a tree structure that maps entries in the way they are organized inside the archive. An instance of ArchiveEntryTree also acts as the root node: all entry nodes are children of it (direct or indirect).

Author:
Maxence Bernard
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
ArchiveEntryTree()
          Creates a new empty tree.
 
Method Summary
 void addArchiveEntry(ArchiveEntry entry)
          Adds the given entry to the archive tree, creating parent nodes as necessary.
 javax.swing.tree.DefaultMutableTreeNode findEntryNode(java.lang.String entryPath)
          Finds and returns the node that corresponds to the specified entry path, null if no entry matching the path could be found.
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ArchiveEntryTree

public ArchiveEntryTree()
Creates a new empty tree.

Method Detail

addArchiveEntry

public void addArchiveEntry(ArchiveEntry entry)
Adds the given entry to the archive tree, creating parent nodes as necessary.

Parameters:
entry - the entry to add to the tree

findEntryNode

public javax.swing.tree.DefaultMutableTreeNode findEntryNode(java.lang.String entryPath)
Finds and returns the node that corresponds to the specified entry path, null if no entry matching the path could be found.

Important note: the given path's separator character must be '/' and the path must be relative to the archive's root, i.e. not start with a leading '/', otherwise the entry will not be found. Trailing separators are ignored when paths are compared, for example the path 'temp' will match the entry 'temp/'.

Parameters:
entryPath - the path to the entry to look up in this tree
Returns:
the node that corresponds to the specified entry path


This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard