Java Doc for AVPair.java in  » Portal » Open-Portal » com » sun » portal » search » soif » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Portal » Open Portal » com.sun.portal.search.soif 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.portal.search.soif.AVPair

AVPair
public class AVPair (Code)
AVPair - a class used to represent a SOIF attribute-value pair.

SOIF AVPairs may be text or binary. Other types should be encoded by convention.
SOIF AVPairs may be multivalued.

This implementation will save data as either strings or byte arrays. If data is saved as a byte array, but requested as a string, an implicit conversion from binary to text is performed using the current character encoding. A conversion is also performed when an attribute is written in one encoding, but read in another.

NB: byte array entries are stored by reference and shared with caller. String entries are never shared.
See Also:   SOIF


Inner Class :class AVValue

Field Summary
public  Stringattribute
     Attribute name.
public  AVValue[]value
     Attribute value.

Constructor Summary
 AVPair()
    
public  AVPair(String att)
    
public  AVPair(String att, String val)
     Constructs a new AVPairs instance with a String value.
public  AVPair(String att, byte[] bval)
     Constructs a new AVPairs instance with a byte array value.
public  AVPair(String att, String val, int index)
     Constructs an AVPair consisting of a String value with the given index.
public  AVPair(String att, byte[] bval, int index)
     Constructs an AVPair consisting of a byte array value with the given index.
public  AVPair(String att, byte[] bval, int index, String encoding)
     Constructs an AVPair consisting of a String value with the given index and encoding.

Method Summary
public  intcontentSize()
    
protected  voidensureCapacity(int size)
    
public  StringgetAttribute()
    
public  byte[][]getByteValues()
     Gets all valid values of this attribute.
public  byte[]getBytes()
    
public  byte[]getBytes(int i)
    
public  intgetMaxIndex()
    
public  String[]getStringValues()
     Gets all valid values of this attribute.
public  StringgetValue()
    
public  StringgetValue(int i)
    
public  booleaninsert(String v, int index)
     Inserts a String at the given index, no duplicates.
public  booleaninsert(byte[] b, int index)
     Inserts a byte array at the given index, no duplicates.
public  booleanisMV()
    
public  booleannthValid(int n)
    
public  booleanremove(int index)
     Removes a mutivalued entry by index.
public  booleanreplace(String v, int index)
     Replaces the string at the given index.
public  booleanreplace(byte[] b, int index)
     Replaces the byte array at the given index.
public  voidsetAttribute(String s)
     (Re)names an AVPair.
public  intsize()
    
public  voidsqueeze()
     Packs the index array by closing all holes towards the index zero.
public  StringtoString()
    
public  intvalueCount()
    

Field Detail
attribute
public String attribute(Code)
Attribute name. Multivalued attr bob-1, bob-2, bob-4 have the name bob. Case is preserved, although SOIF lookups are case insensitive.



value
public AVValue[] value(Code)
Attribute value. Can be binary (assumed when reading from stream) For internal use, directly supports String values for efficiency.




Constructor Detail
AVPair
AVPair()(Code)
Constructs an empty, unnamed AVPair instance (mainly for testing)



AVPair
public AVPair(String att)(Code)
Constructs an empty, named AVPair instance
Parameters:
  att - the attribute



AVPair
public AVPair(String att, String val)(Code)
Constructs a new AVPairs instance with a String value.
Parameters:
  att - the attribute
Parameters:
  val - the value



AVPair
public AVPair(String att, byte[] bval)(Code)
Constructs a new AVPairs instance with a byte array value.
Parameters:
  att - the attribute
Parameters:
  val - the value



AVPair
public AVPair(String att, String val, int index)(Code)
Constructs an AVPair consisting of a String value with the given index.



AVPair
public AVPair(String att, byte[] bval, int index)(Code)
Constructs an AVPair consisting of a byte array value with the given index.



AVPair
public AVPair(String att, byte[] bval, int index, String encoding)(Code)
Constructs an AVPair consisting of a String value with the given index and encoding.




Method Detail
contentSize
public int contentSize()(Code)
size of AVPair contents in bytes



ensureCapacity
protected void ensureCapacity(int size)(Code)
Ensure arrays are big enough - blocking factor? - use a single Object array?



getAttribute
public String getAttribute()(Code)
the attribute name for this AVPair.



getByteValues
public byte[][] getByteValues()(Code)
Gets all valid values of this attribute. an array of byte arrays formultiple values for an attribute, e.g., for image, returnvalues for image-1 and image-2.



getBytes
public byte[] getBytes()(Code)
the value of this AVPair (uses the first occupied slot if multivalued)



getBytes
public byte[] getBytes(int i)(Code)

Parameters:
  i - multivalue index byte array value at index i



getMaxIndex
public int getMaxIndex()(Code)
the maximum occupied index.



getStringValues
public String[] getStringValues()(Code)
Gets all valid values of this attribute. an array of Strings formultiple values for an attribute, e.g., for Bob, returnvalues for Bob-1 and Bob-2.



getValue
public String getValue()(Code)
the value of this AVPair (uses the first occupied slot if multivalued)



getValue
public String getValue(int i)(Code)

Parameters:
  i - multivalue index String value at index i



insert
public boolean insert(String v, int index)(Code)
Inserts a String at the given index, no duplicates. false if slot already taken



insert
public boolean insert(byte[] b, int index)(Code)
Inserts a byte array at the given index, no duplicates. false if slot already taken



isMV
public boolean isMV()(Code)
true if APVair is multivalued



nthValid
public boolean nthValid(int n)(Code)
true if the value at index n exists and is non-null



remove
public boolean remove(int index)(Code)
Removes a mutivalued entry by index. false if index was not occupied



replace
public boolean replace(String v, int index)(Code)
Replaces the string at the given index. false if slot already taken



replace
public boolean replace(byte[] b, int index)(Code)
Replaces the byte array at the given index. false if slot already taken



setAttribute
public void setAttribute(String s)(Code)
(Re)names an AVPair.



size
public int size()(Code)
the total size - some values may be null



squeeze
public void squeeze()(Code)
Packs the index array by closing all holes towards the index zero.



toString
public String toString()(Code)
a String representation of this AVPair - mainly for debugging



valueCount
public int valueCount()(Code)
the number of non-null values for this attribute.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.