Class Instructions

  • All Implemented Interfaces:
    java.util.Map<Instruction,​Attrs>

    public class Instructions
    extends java.lang.Object
    implements java.util.Map<Instruction,​Attrs>
    • Constructor Detail

      • Instructions

        public Instructions​(java.util.Collection<java.lang.String> other)
      • Instructions

        public Instructions()
      • Instructions

        public Instructions​(Parameters contained)
      • Instructions

        public Instructions​(java.lang.String h)
    • Method Detail

      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Map<Instruction,​Attrs>
      • containsKey

        public boolean containsKey​(Instruction name)
      • containsKey

        @Deprecated
        public boolean containsKey​(java.lang.Object name)
        Deprecated.
        Specified by:
        containsKey in interface java.util.Map<Instruction,​Attrs>
      • containsValue

        public boolean containsValue​(Attrs value)
      • containsValue

        @Deprecated
        public boolean containsValue​(java.lang.Object value)
        Deprecated.
        Specified by:
        containsValue in interface java.util.Map<Instruction,​Attrs>
      • entrySet

        public java.util.Set<java.util.Map.Entry<Instruction,​Attrs>> entrySet()
        Specified by:
        entrySet in interface java.util.Map<Instruction,​Attrs>
      • get

        @Deprecated
        public Attrs get​(java.lang.Object key)
        Deprecated.
        Specified by:
        get in interface java.util.Map<Instruction,​Attrs>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Map<Instruction,​Attrs>
      • putAll

        public void putAll​(java.util.Map<? extends Instruction,​? extends Attrs> map)
        Specified by:
        putAll in interface java.util.Map<Instruction,​Attrs>
      • remove

        @Deprecated
        public Attrs remove​(java.lang.Object var0)
        Deprecated.
        Specified by:
        remove in interface java.util.Map<Instruction,​Attrs>
      • size

        public int size()
        Specified by:
        size in interface java.util.Map<Instruction,​Attrs>
      • values

        public java.util.Collection<Attrs> values()
        Specified by:
        values in interface java.util.Map<Instruction,​Attrs>
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • append

        public void append​(Parameters other)
      • appendIfAbsent

        public void appendIfAbsent​(Parameters other)
      • select

        public <T> java.util.Collection<T> select​(java.util.Collection<T> set,
                                                  boolean emptyIsAll)
      • select

        public <T> java.util.Collection<T> select​(java.util.Collection<T> set,
                                                  java.util.Set<Instruction> unused,
                                                  boolean emptyIsAll)
      • reject

        public <T> java.util.Collection<T> reject​(java.util.Collection<T> set)
      • matcher

        public Instruction matcher​(java.lang.String value)
      • finder

        public Instruction finder​(java.lang.String value)
      • matches

        public boolean matches​(java.lang.String value)
      • matchesStream

        public aQute.bnd.stream.MapStream<Instruction,​Attrs> matchesStream​(java.lang.String value)
      • select

        public java.util.Map<java.io.File,​java.util.List<Attrs>> select​(java.io.File base,
                                                                              java.util.function.Function<java.lang.String,​java.lang.String> mapper,
                                                                              java.util.Set<Instruction> missing)
        Turn this Instructions into a map of File -> Attrs. You can specify a base directory, which will match all files in that directory against the specification or you can use literal instructions to get files from anywhere.

        A mapping function can be provided to rename literal names. This was added to map '.' and '' to 'bnd.bnd'. However, this can be generally useful.

        Parameters:
        base - The directory to list files from.
        mapper - Maps the literal names.
        Returns:
        The map that links files to attributes
      • decorate

        public void decorate​(Parameters parameters)
        Match the instruction against the parameters and merge the attributes if matches. Remove any negated instructions. Literal unmatched instructions are not added
        Parameters:
        parameters - the parameters to decorate
      • decorate

        public void decorate​(Parameters parameters,
                             boolean addLiterals)
        Match the instruction against the parameters and merge the attributes if matches. Remove any negated instructions. Literal unmatched instructions are added if the addLiterals is true
        Parameters:
        parameters - the parameters to decorate
        addLiterals - add literals to the output