private void addBlocks(ReversiblePeekingIterable<Node> nodes) {
   for (Node child : nodes) {
     if (child instanceof Block) {
       allBlockParsersMap.putValueKey((Block) child, null);
     }
   }
 }
 private void removeBlocks(ReversiblePeekingIterable<Node> nodes) {
   for (Node child : nodes) {
     if (child instanceof Block) {
       allBlockParsersMap.removeValue(child);
     }
   }
 }
 @Override
 public void blockParserAdded(BlockParser blockParser) {
   allBlockParsersMap.putKeyValue(blockParser, blockParser.getBlock());
 }
 public boolean containsValue(Block parser) {
   return allBlockParsersMap.containsValue(parser);
 }
 public boolean containsKey(BlockParser parser) {
   return allBlockParsersMap.containsKey(parser);
 }
 public BlockParser getKey(Block parser) {
   return allBlockParsersMap.getValueKey(parser);
 }
 public Block getValue(BlockParser parser) {
   return allBlockParsersMap.getKeyValue(parser);
 }
 public OrderedSet<Block> allBlocks() {
   return allBlockParsersMap.valueSet();
 }
 @Override
 public void blockAddedWithDescendants(Block node) {
   validateLinked(node);
   allBlockParsersMap.putValueKey(node, null);
   addBlocks(node.getDescendants());
 }
Ejemplo n.º 10
0
 @Override
 public int getIteratorModificationCount() {
   return allBlockParsersMap.getModificationCount();
 }
Ejemplo n.º 11
0
 @Override
 public void blockRemovedWithDescendants(Block node) {
   validateUnlinked(node);
   allBlockParsersMap.removeValue(node);
   removeBlocks(node.getDescendants());
 }
Ejemplo n.º 12
0
 @Override
 public void blockRemovedWithChildren(Block node) {
   validateUnlinked(node);
   allBlockParsersMap.removeValue(node);
   removeBlocks(node.getChildren());
 }
Ejemplo n.º 13
0
 @Override
 public void blockRemoved(Block node) {
   validateUnlinked(node);
   allBlockParsersMap.removeValue(node);
 }
Ejemplo n.º 14
0
 @Override
 public void blockParserRemoved(BlockParser blockParser) {
   allBlockParsersMap.removeKey(blockParser);
 }
Ejemplo n.º 15
0
 public OrderedSet<BlockParser> allBlockParsers() {
   return allBlockParsersMap.keySet();
 }
Ejemplo n.º 16
0
 @Override
 public void blockAdded(Block node) {
   validateLinked(node);
   allBlockParsersMap.putValueKey(node, null);
 }
Ejemplo n.º 17
0
 @Override
 public void blockAddedWithChildren(Block node) {
   validateLinked(node);
   allBlockParsersMap.putValueKey(node, null);
   addBlocks(node.getChildren());
 }