jif.lang

## Class LabelUtil

- java.lang.Object
- - jif.lang.LabelUtil

-     public class LabelUtil
      extends java.lang.Object

  A Label is the run time representation of a Jif label. A Label consists of a set of components, each of which is a `Policy`.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static boolean` | `COUNT_TIME`
    `protected static LabelUtil` | `singleton`
    `static boolean` | `USE_CACHING`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `LabelUtil()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `acts_for(Label actor, Principal granter)`
    `boolean` | `actsFor(Label actor, Principal granter)`
    `ConfPolicy` | `bottomConf()`
    `boolean` | `equivalentTo(Label l1, Label l2)`
    `int` | `getAndClearCount()`
    `long` | `getAndClearTime()`
    `int` | `getAndClearTopCount()`
    `int` | `hashCode(Label lb)`
    `boolean` | `isReadableBy(Label lbl, Principal p)`
    `boolean` | `isWritableBy(Label lbl, Principal p)`
    `ConfPolicy` | `join(ConfPolicy p1, ConfPolicy p2, boolean simplify)`
    `protected ConfPolicy` | `join(ConfPolicy p1, ConfPolicy p2, java.util.Set<jif.lang.PrincipalUtil.DelegationPair> s, boolean simplify)`
    `IntegPolicy` | `join(IntegPolicy p1, IntegPolicy p2, boolean simplify)`
    `Label` | `join(Label l1, Label l2)`
    `Label` | `join(Label l1, Label l2, boolean simplify)`
    `ConfPolicy` | `meet(ConfPolicy p1, ConfPolicy p2, boolean simplify)`
    `protected ConfPolicy` | `meet(ConfPolicy p1, ConfPolicy p2, java.util.Set<jif.lang.PrincipalUtil.DelegationPair> s, boolean simplify)`
    `IntegPolicy` | `meet(IntegPolicy p1, IntegPolicy p2, boolean simplify)`
    `Label` | `meet(Label l1, Label l2)`
    `Label` | `meet(Label l1, Label l2, boolean simplify)`
    `Label` | `noComponents()`
    `ConfPolicy` | `readerPolicy(Label lbl, Principal owner, Principal[] readers)` See the Jif signature for the explanation of lbl.
    `ConfPolicy` | `readerPolicy(Principal owner, java.util.Collection<Principal> readers)`
    `ConfPolicy` | `readerPolicy(Principal owner, Principal reader)`
    `ConfPolicy` | `readerPolicy(Principal owner, PrincipalSet writers)`
    `Label` | `readerPolicyLabel(Label lbl, Principal owner, Principal[] readers)` See the Jif signature for the explanation of lbl.
    `Label` | `readerPolicyLabel(Principal owner, java.util.Collection<Principal> readers)`
    `Label` | `readerPolicyLabel(Principal owner, Principal reader)`
    `Label` | `readerPolicyLabel(Principal owner, PrincipalSet readers)`
    `boolean` | `relabelsTo(Label from, Label to)`
    `boolean` | `relabelsTo(Policy from, Policy to)`
    `boolean` | `relabelsTo(Policy from, Policy to, java.util.Set<jif.lang.PrincipalUtil.DelegationPair> s)`
    `static LabelUtil` | `singleton()`
    `java.lang.String` | `stringValue(Label lb)`
    `Label` | `toLabel(ConfPolicy policy)`
    `Label` | `toLabel(ConfPolicy cPolicy, IntegPolicy iPolicy)`
    `Label` | `toLabel(IntegPolicy policy)`
    `ConfPolicy` | `topConf()`
    `IntegPolicy` | `topInteg()`
    `java.lang.String` | `toString(Label lb)`
    `IntegPolicy` | `writerPolicy(Label lbl, Principal owner, Principal[] writers)` See the Jif signature for the explanation of lbl.
    `IntegPolicy` | `writerPolicy(Principal owner, java.util.Collection<Principal> writers)`
    `IntegPolicy` | `writerPolicy(Principal owner, Principal writer)`
    `IntegPolicy` | `writerPolicy(Principal owner, PrincipalSet writers)`
    `Label` | `writerPolicyLabel(Label lbl, Principal owner, Principal[] writers)` See the Jif signature for the explanation of lbl.
    `Label` | `writerPolicyLabel(Principal owner, java.util.Collection<Principal> writers)`
    `Label` | `writerPolicyLabel(Principal owner, Principal writer)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### singleton

          protected static LabelUtil singleton

    - #### COUNT_TIME

          public static final boolean COUNT_TIME

      See Also:
        Constant Field Values

    - #### USE_CACHING

          public static final boolean USE_CACHING

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### LabelUtil

          protected LabelUtil()

  - ### Method Detail

    - #### singleton

          public static LabelUtil singleton()

    - #### getAndClearTime

          public long getAndClearTime()

    - #### getAndClearCount

          public int getAndClearCount()

    - #### getAndClearTopCount

          public int getAndClearTopCount()

    - #### noComponents

          public Label noComponents()

    - #### bottomConf

          public ConfPolicy bottomConf()

    - #### topConf

          public ConfPolicy topConf()

    - #### topInteg

          public IntegPolicy topInteg()

    - #### readerPolicy

          public ConfPolicy readerPolicy(Principal owner,
                                         Principal reader)

    - #### readerPolicy

          public ConfPolicy readerPolicy(Principal owner,
                                         java.util.Collection<Principal> readers)

    - #### readerPolicy

          public ConfPolicy readerPolicy(Label lbl,
                                         Principal owner,
                                         Principal[] readers)

      See the Jif signature for the explanation of lbl.

    - #### readerPolicy

          public ConfPolicy readerPolicy(Principal owner,
                                         PrincipalSet writers)

    - #### readerPolicyLabel

          public Label readerPolicyLabel(Principal owner,
                                         Principal reader)

    - #### readerPolicyLabel

          public Label readerPolicyLabel(Principal owner,
                                         java.util.Collection<Principal> readers)

    - #### readerPolicyLabel

          public Label readerPolicyLabel(Label lbl,
                                         Principal owner,
                                         Principal[] readers)

      See the Jif signature for the explanation of lbl.

    - #### readerPolicyLabel

          public Label readerPolicyLabel(Principal owner,
                                         PrincipalSet readers)

    - #### writerPolicy

          public IntegPolicy writerPolicy(Principal owner,
                                          Principal writer)

    - #### writerPolicy

          public IntegPolicy writerPolicy(Principal owner,
                                          java.util.Collection<Principal> writers)

    - #### writerPolicyLabel

          public Label writerPolicyLabel(Principal owner,
                                         Principal writer)

    - #### writerPolicyLabel

          public Label writerPolicyLabel(Principal owner,
                                         java.util.Collection<Principal> writers)

    - #### writerPolicyLabel

          public Label writerPolicyLabel(Label lbl,
                                         Principal owner,
                                         Principal[] writers)

      See the Jif signature for the explanation of lbl.

    - #### writerPolicy

          public IntegPolicy writerPolicy(Label lbl,
                                          Principal owner,
                                          Principal[] writers)

      See the Jif signature for the explanation of lbl.

    - #### writerPolicy

          public IntegPolicy writerPolicy(Principal owner,
                                          PrincipalSet writers)

    - #### toLabel

          public Label toLabel(ConfPolicy cPolicy,
                               IntegPolicy iPolicy)

    - #### toLabel

          public Label toLabel(ConfPolicy policy)

      Returns:
        a label representing untrusted information at the given confidentiality policy level.

    - #### toLabel

          public Label toLabel(IntegPolicy policy)

      Returns:
        a label representing public information at the given integrity policy level.

    - #### join

          public Label join(Label l1,
                            Label l2)

    - #### join

          public Label join(Label l1,
                            Label l2,
                            boolean simplify)

    - #### meet

          public Label meet(Label l1,
                            Label l2)

    - #### meet

          public Label meet(Label l1,
                            Label l2,
                            boolean simplify)

    - #### join

          public ConfPolicy join(ConfPolicy p1,
                                 ConfPolicy p2,
                                 boolean simplify)

    - #### join

          protected ConfPolicy join(ConfPolicy p1,
                                    ConfPolicy p2,
                                    java.util.Set<jif.lang.PrincipalUtil.DelegationPair> s,
                                    boolean simplify)

    - #### join

          public IntegPolicy join(IntegPolicy p1,
                                  IntegPolicy p2,
                                  boolean simplify)

    - #### meet

          public ConfPolicy meet(ConfPolicy p1,
                                 ConfPolicy p2,
                                 boolean simplify)

    - #### meet

          protected ConfPolicy meet(ConfPolicy p1,
                                    ConfPolicy p2,
                                    java.util.Set<jif.lang.PrincipalUtil.DelegationPair> s,
                                    boolean simplify)

    - #### meet

          public IntegPolicy meet(IntegPolicy p1,
                                  IntegPolicy p2,
                                  boolean simplify)

    - #### equivalentTo

          public boolean equivalentTo(Label l1,
                                      Label l2)

    - #### isReadableBy

          public boolean isReadableBy(Label lbl,
                                      Principal p)

    - #### isWritableBy

          public boolean isWritableBy(Label lbl,
                                      Principal p)

    - #### relabelsTo

          public boolean relabelsTo(Label from,
                                    Label to)

      Returns:
        true iff from <= to in the information-flow ordering.

    - #### acts_for

          public boolean acts_for(Label actor,
                                  Principal granter)

    - #### actsFor

          public boolean actsFor(Label actor,
                                 Principal granter)

    - #### relabelsTo

          public boolean relabelsTo(Policy from,
                                    Policy to)

    - #### relabelsTo

          public boolean relabelsTo(Policy from,
                                    Policy to,
                                    java.util.Set<jif.lang.PrincipalUtil.DelegationPair> s)

    - #### stringValue

          public java.lang.String stringValue(Label lb)

    - #### toString

          public java.lang.String toString(Label lb)

    - #### hashCode

          public int hashCode(Label lb)