public class

GeneralSubtrees

extends Object
implements Cloneable
java.lang.Object
   ↳ sun.security.x509.GeneralSubtrees

Class Overview

Represent the GeneralSubtrees ASN.1 object.

The ASN.1 for this is

 GeneralSubtrees ::= SEQUENCE SIZE (1..MAX) OF GeneralSubtree
 

Summary

Public Constructors
GeneralSubtrees()
The default constructor for the class.
GeneralSubtrees(DerValue val)
Create the object from the passed DER encoded form.
Public Methods
void add(GeneralSubtree tree)
Object clone()
Creates and returns a copy of this object.
boolean contains(GeneralSubtree tree)
void encode(DerOutputStream out)
Encode the GeneralSubtrees.
boolean equals(Object obj)
Compare two general subtrees by comparing the subtrees of each.
GeneralSubtree get(int index)
int hashCode()
Returns a hash code value for the object.
GeneralSubtrees intersect(GeneralSubtrees other)
intersect this GeneralSubtrees with other.
Iterator<GeneralSubtree> iterator()
void reduce(GeneralSubtrees excluded)
reduce this GeneralSubtrees by contents of another.
void remove(int index)
int size()
String toString()
Return a printable string of the GeneralSubtree.
List<GeneralSubtree> trees()
void union(GeneralSubtrees other)
construct union of this GeneralSubtrees with other.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public GeneralSubtrees ()

The default constructor for the class.

public GeneralSubtrees (DerValue val)

Create the object from the passed DER encoded form.

Parameters
val the DER encoded form of the same.
Throws
IOException

Public Methods

public void add (GeneralSubtree tree)

public Object clone ()

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

 x.clone() != x
will be true, and that the expression:
 x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
 x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

The method clone for class Object performs a specific cloning operation. First, if the class of this object does not implement the interface Cloneable, then a CloneNotSupportedException is thrown. Note that all arrays are considered to implement the interface Cloneable. Otherwise, this method creates a new instance of the class of this object and initializes all its fields with exactly the contents of the corresponding fields of this object, as if by assignment; the contents of the fields are not themselves cloned. Thus, this method performs a "shallow copy" of this object, not a "deep copy" operation.

The class Object does not itself implement the interface Cloneable, so calling the clone method on an object whose class is Object will result in throwing an exception at run time.

Returns
  • a clone of this instance.

public boolean contains (GeneralSubtree tree)

public void encode (DerOutputStream out)

Encode the GeneralSubtrees.

Throws
IOException

public boolean equals (Object obj)

Compare two general subtrees by comparing the subtrees of each.

Parameters
obj the reference object with which to compare.
Returns
  • true if this object is the same as the obj argument; false otherwise.

public GeneralSubtree get (int index)

public int hashCode ()

Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals(java.lang.Object) method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hashtables.

As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by the JavaTM programming language.)

Returns
  • a hash code value for this object.

public GeneralSubtrees intersect (GeneralSubtrees other)

intersect this GeneralSubtrees with other. This function is used in merging permitted NameConstraints. The operation is performed as follows:

  • If a name in other narrows all names of the same type in this, the result will contain the narrower name and none of the names it narrows.
  • If a name in other widens all names of the same type in this, the result will not contain the wider name.
  • If a name in other does not share the same subtree with any name of the same type in this, then the name is added to the list of GeneralSubtrees returned. These names should be added to the list of names that are specifically excluded. The reason is that, if the intersection is empty, then no names of that type are permitted, and the only way to express this in NameConstraints is to include the name in excludedNames.
  • If a name in this has no name of the same type in other, then the result contains the name in this. No name of a given type means the name type is completely permitted.
  • If a name in other has no name of the same type in this, then the result contains the name in other. This means that the name is now constrained in some way, whereas before it was completely permitted.

Parameters
other GeneralSubtrees to be intersected with this

public Iterator<GeneralSubtree> iterator ()

public void reduce (GeneralSubtrees excluded)

reduce this GeneralSubtrees by contents of another. This function is used in merging excluded NameConstraints with permitted NameConstraints to obtain a minimal form of permitted NameConstraints. It is an optimization, and does not affect correctness of the results.

Parameters
excluded GeneralSubtrees

public void remove (int index)

public int size ()

public String toString ()

Return a printable string of the GeneralSubtree.

Returns
  • a string representation of the object.

public List<GeneralSubtree> trees ()

public void union (GeneralSubtrees other)

construct union of this GeneralSubtrees with other.

Parameters
other GeneralSubtrees to be united with this