Class NamespaceStack

java.lang.Object
brut.androlib.res.data.axml.NamespaceStack

public final class NamespaceStack extends Object
Namespace stack, holds prefix+uri pairs, as well as depth information. All information is stored in one int[] array. Array consists of depth frames: Data=DepthFrame*; DepthFrame=Count+[Prefix+Uri]*+Count; Count='count of Prefix+Uri pairs'; Yes, count is stored twice, to enable bottom-up traversal. increaseDepth adds depth frame, decreaseDepth removes it. push/pop operations operate only in current depth frame. decreaseDepth removes any remaining (not pop'ed) namespace pairs. findXXX methods search all depth frames starting from the last namespace pair of current depth frame. All functions that operate with int, use -1 as 'invalid value'.

!! functions expect 'prefix'+'uri' pairs, not 'uri'+'prefix' !!

  • Constructor Details

    • NamespaceStack

      public NamespaceStack()
  • Method Details

    • reset

      public void reset()
    • getCurrentCount

      public int getCurrentCount()
    • getAccumulatedCount

      public int getAccumulatedCount(int depth)
    • push

      public void push(int prefix, int uri)
    • pop

      public boolean pop()
    • getPrefix

      public int getPrefix(int index)
    • getUri

      public int getUri(int index)
    • findPrefix

      public int findPrefix(int uri)
    • getDepth

      public int getDepth()
    • increaseDepth

      public void increaseDepth()
    • decreaseDepth

      public void decreaseDepth()