R.W.M. Johnson
The place of capital in agricultural expansion in New Zealand has been largely neglected in the past. Part of the explanation for this lies in the lack of adequate statistics - the official series on capital expenditure on farms only started in 1965-66. Partly the explanation lies in the fact that capital expenditure has been largely autonomous in the agricultural sector and no assistance or encouragement was thought necessary. In fact, investment is not strictly autonomous in the full sense of the word, rather it is generated from within the sector and occurs without making an impact on the institutional framework providing capital to agriculture generally. In part, anyway, this is because the institutional structure is largely geared to financing land purchase and not farm development and expansion per se.
As a result of the shortage of official statistics this analysis is largely based on the independent work carried out at Lincoln College in the 1960's. Official statistics have been used, however, to bring the Lincoln work up to date, and more recent observations are drawn from the Agroscope survey of farmer's capital expenditure carried out by Farm Market Index Ltd. These various sources provide data for the period from 1945-46 to 1978-79.
The paper first examines the historical pattern of capital expenditure in New Zealand agriculture since the war and develops a simple economic model of real net investment I along the lines earlier published by Lincoln College. From this examination certain conclusions can be drawn about the pattern of investment in the post war period. Secondly, the paper reviews the available evidence on the propensity to invest in agriculture in New Zealand and the implications of this for national policy-making. The paper concludes with a discussion of present policy measures and needed developments to encourage the right production response in line with national objectives.
The following discussion is based on the usual definitions of capital investment in a system of national accounts. Gross investment is all expenditure on capital goods by agricultural firms in the fiscal period or March year. Capital goods are durable goods which contribute to further productive effort.
2.
Net investment is the true increment of capital added to the national capital stock in the given period. The difference between gross and net investment is thus true replacement expenditure or economic depreciation. It should be noted that the Lincoln College data used is devised from a concept of true economic depreciation and hence the derived data on net investment is not comparable with other data series based on Inland Revenue permitted rates of depreciation.
Table l brings together the available gross investment data for the period 1945-46 to 1978-79. Up to 1968-69 the series is derived from estimates aggregating individual items of capital expenditure found in secondary statistical sources. It is not a direct measure of capital investment. From 1969-70 the Statistics Department's series of capital expenditure on farms is used - this being a direct census of all farms in New Zealand. The last published year of results of the official survey is 1976-77. The remaining data is derived from a random sample of farmers interviewed by Farm Market Index Ltd. Their questions are modelled on the Statistics Department's questionnaire.
Over the period under review the money value of gross investment in agriculture has increased twenty fold. Over the same period product prices have increased by five times, thus the real value of capital investment has increased by a factor of four. There has been a steady build up of investment in land improvements over the years and also in additional farm buildings.
Investment in plant has fluctuated more over the years and has shown marked price increases in recent years. Since 1949-50, land improvement prices have increased by six times and plant and machinery prices have increased by eight times. As a result of these differential price trends real gross investment in land and buildings has doubled since 1949-50 while that of plant and machinery has only increased by a factor of 1.33 over this period. (Such comparisons do not take account of changes in the technical efficiency of plant, only changes in prices).
Some of this gross investment is for replacement purchases only. The Lincoln College data has identified the share of total investment which is for replacement and the same rules have been applied to the data since 1968-69. At the same time, the net investment series I is converted to real terms by the use of the price indices referred to in the previous paragraph. The resulting calculations are shown in Table 2 along with the value of livestock employed on farms from the Lincoln College data - all at 1949-50 prices. Graph 1 shows the trends in real net investment in Iand and buildings and in plant and machinery for the period 1945-46 to 1978-79.
3.
It can be seen that net additional real investment in land improvements and buildings built up very quickly in the early post-war period reaching a peak in 1955-56, then plateaued somewhat before building up to a further peak from 1960-61 to 1966-67. Thereafter there was a rapid decline in real net investment reaching its lowest level in 1971-72. Two good years then followed and the subsequent years have tended to stabilise at about the real level of the early 1960's. It is clear that net additions to the productive assets have been made in all the post-war years, but also that the growth rate of the 1950's and 1960's has not been maintained into the 1970's.
The real net investment pattern for plant and machinery is quite different. There was a very marked re-equipment period after the war peaking in the years 1949-50 to 1952-53. Thereafter the additions to the stock were very small through the late 1950's and the 1960's. Some of this could represent delayed re-equipping as there was a marked up-surge of net investment in plant and machinery in 1971-72, 1972-73 and 1973-74. After this last year the pattern of the 1960's has re-asserted itself. Thus from 1960 to 1970 there was apparently a marked increase in the efficiency of plant use as production kept on expanding with a fairly constant stock of machinery. In the 1970's re-equipment showed a reverse trend in efficiency and by the end of the decade a stable ratio was being achieved.
From statistics of real net investment, it is possible to proceed to estimates of the real capital stock employed in agriculture. The Lincoln College statistics establish a base year stock for land and buildings in the 1966-67 season and that for plant and machinery in the 1949-50 season. Given a base year, the time series of capital stock are generated by simply adding or subtracting the real net investment increments in every year. The results of this process are shown in Table 3.
The trends in real net investment discussed earlier can now be assessed against the total stock of capital employed. As Table 4 shows, the growth of land and buildings stock has been very steady over the seven five-year periods since 1945.
There has been some decline in the rate of growth of land and buildings stock in the two five year periods since 1970, but growth nevertheless persisted. The fluctuations in the growth of the stock of plant and machinery are now much more apparent. Particularly so 1950 to 1955 and again, from 1970 to 1975. There was actually a net decline in the plant stock between 1965 and 1970. Livestock shows the growth behaviour already well known and documented. Such might be expected from a set of price weights as compared with a set of feed equivalents!
4.
The strong contrast in the behaviour of land and building stocks and the livestock series since 1969 is illustrated in Graph 2. Up to 1969 a strong association was evident between livestock expansion and the land and building stock. After 1969 there is a complete break and this requires further examination.
The first question to ask is whether the statistical material can stand the burden being placed on it? 7 There is little doubt about the accuracy of the livestock series, hence the construction of the land and buildings series should be questioned. The gross expenditure series is reliable, the price series are fairly reliable but there is some doubt about the adjustments for replacement of capital goods.
The average rate of replacement in the Lincoln series worked out at 1% of the real capital stock of land and buildings up to 1969 and this has been assumed for the period after 1969. If this 1% is an underestimate then of course the growth of the stock series would be less. It can be calculated that a replacement rate of 2.25% would cancel out the growth factor - hence further research is needed to see whether this factor can be more narrowly defined.
Secondly, it could be asked if there has been any structural change in capital investment in the 1970's? The balance between land development and buildings investment can be judged by examining the gross money investment series in Table 1. It can be seen that up to 1973-74 there was a rough equality between the series. From that date onwards, however, building investment has tended to increase relative to land improvement investment. Given New Zealand's pastoral comparative advantage, this last trend could well be one of the explanations for the decline in the growth of production in recent years. A further breakdown of recent data is shown in Table 5. New houses have increased slightly as a proportion of total building investment.
Thirdly, it may well be that the type of farming requiring new investment is changing. Statistics Department data is available on gross investment trends by type of farming, though again these are not perfect as the definitions of type of farming have been changed in the period concerned. Table 6 shows the main farm types which can be deduced from the Statistics presentation.
The sheep and beef sector has maintained a constant share of the total; the dairy sector has slowly declined, especially since 1971-72; the crop sector has maintained a constant share except for the years for which data is incomplete; market gardens have steadily increased their share (they are the only horticultural group for which a continuous series is available), and the residual group of "other" has steadily increased its share. This is partly due to the wider coverage of the survey and partly due to the growth of miscellaneous activities such as orchards, poultry farming, stud farming and plantations.
5.
Aggregate gross investment in these items has increased ten fold in the period from 1966-67 to 1976-77. It might be worth researching if these "other" items have a higher component than average of buildings investment rather than "land" investment.
All in all, there is a clear trend away from the pastoral sector, mainly due to the relative decline in dairy investment, and a growth of the miscellaneous sector which includes horticulture and other activities as well. The evidence is not conclusive enough, however, to explain static production trends of itself.
Recent Government policy is best understood against a background discussion of the financial structure of the agricultural sector. This section of the paper therefore discusses the financing of annual production and capital investment, the relation between capital investment and net income and the different stages of development which individual farmers can pass through. The third section will discuss the evolution of Government policy in recent years with regard to assistance for capital investment in agriculture.
In 1977-78 the total value of assets employed in New Zealand agriculture, including live stock, was $11.5 billion. This was made up as follows:
| $(million) | |
| Land and Buildings | 8 300 |
| Plant and Machinery | 1 500 |
| Livestock | 1 760 |
| Total | 11 560 |
There were some 60,000 full-time farm holdings employing about 130,000 people in active production. There were thus about $200,000 of assets per farm and $100,000 of assets per person engaged.
As already noted in the previous section some $357 million was spent in 1977-78 on new farm assets, either replacing old ones or adding new ones. Some $140 million was spent on plant and machinery and $217 million on land and buildings. In addition to these expenditures it is estimated that some · $400 million was spent in 1977-78 on farm purchase, that is largely but not completely on the financing of younger or new farmers on to properties of their own. The balance of . this money was spent on financing farmers into better propositions, up the agricultural ladder, into semi-retirement etc.
Leaving aside the financing of farm purchase, it is estimated that in 1977-78 some $3,000 million was spent in simply financing annual production and investment on farms in production. The details of this calculation are shown in an appendix to this paper.
6.
The position can be summarised, however, in the following simple version of the estimates made.
| Cash Flow New Zealand Agriculture 1977-78 $(million) | |||
|---|---|---|---|
| Ingoings | Outgoings | ||
| Sales of Product | 2,600 | Materials | 1,610 |
| Loans not for purchase | 420 | Wages Interest Tax Principal repaid Investments Living Expenses |
280 190 130 240 50 520 |
| 3,020 | 3,020 |
Thus, some 86 percent of annual outgoings are financed from the sale of product with only 14 percent financed by way of a net increase in borrowing. (Only the net increase in bank and stock and station borrowing has been-included in the figures). On the outgoings side some 53 percent of the inflow is spent on materials - this includes livestock purchases, current inputs, and capital goods, but not depreciation. The remainder is made up from wages of employees (9 percent), interest on borrowings (6 percent), repayment of principal (8 percent), taxation on previous years earnings (4 percent) and general living expenses (7 percent). A small allowance has been made for off-farm investment - $50 million - there is very little reliable data on this component.
At any one time the total amount of short-term credit is much greater than that shown. As at the end of July 1978 total trading bank term lending was $94 million, and as at March 31 stock and station agents, advances were $197 million At the height of the growing season the amount would be greater than this. The net change in the total advances to the farming industry over the last two years are made up as follows:
| 1976-77 | 1977-78 | |
| $(million) | $(million) | |
| Rural Bank development loans | 74.3 | 132.3 |
| Term loans | 23.4 | 7.5 |
| Trading Bank advances | 58.8 | 59.3 |
| Stock and Station agents | -12.7 | 61.1 |
| Private loans | 150.0 | 160.0 |
| Subtotal | 293.8 | 420.2 |
| Proprietor's surplus | 857.0 | 614.0 |
7.
Further examination of these statistics over a longer term would reveal the underlying pattern of how the net change in financing is relating to the general prosperity of the . industry. Loan finance not only provides within season working capital, and new investment capital, but also provides a cushion in which year-to-year fluctuations in farming income can be absorbed without calamitous effects both on the standards of living of farmers and their investment activities - the general objective 5f?this report. The predominant feature of the financial system remains the annual sale of product as far as farmers are concerned. In the broader context, of course, their propensity to invest will be coloured by their expectations as to future price 4 and volume trends as well as those of the immediate past. . Further, their judgements will also be influenced by other factors of a non-economic kind such as their perception of their place in the total society, and the future of that society as it affects them.
The strongest economic factor, however, remains the availability of finance out of current earnings. The statistical evidence for this relationship is not particularly strong. Graph 3 shows the net national income in farming - or proprietors' surplus as it is now called - for the period 1946 to 1978 compared with gross agricultural capital expenditure. In the period up to 1972, when income fluctuations were much smaller than in the 1970's, small adverse changes in net income were scarcely reflected in changes in capital expenditure e.g. in 1958-59 and 1967-68. In other years capital expenditure was maintained irrespective of income changes. Since 1972, capital investment has followed up the sharp increase in the money value of incomes, with a set back in 1974-75 reflected in both series.
V Another criteria for judging the propensity to invest is the percentage of proprietors? surplus used for gross investment.
In five year periods, the percentage has varied as follows:
1946-47 ? 1950-51 21.3
1951-52 ? 1955-56 28.5
1956-57 - 1960-61 26.3
1961-62 - 1965-66 29.4
1966-67 - 1970-71 34.0
1971-72 - 1975-76 31.4
1976-77 - 1978-79 46.2
Mean 28.9
This therefore shows how investment levels rose relative to income in the early 1950?s, fell off slightly in the late 1950?s, rose again through the whole of the 1960's, tended to fall slightly in the early 1970?s as a whole, and then recovered considerably in the late 1970?s. Since some of the investment must be generated from the farmers? own income there could be an inverse relationship between these two series in some years.
8.
Finally the marginal propensity to invest from the above data is shown in the following equations:
Y = 37.8 + 0.44 X where Y = Investment
R2= 0.86 X = Net Income
DW= 0.93
SE= 0.03
Further investigative work is required to define the independent variables more appropriately, including distributed lags, wider definitions of income, and other explanatory variables.
As well as a high propensity to invest out of current income, the investment process in pastoral farming is characterised by a definite cycle of spending and profits. Some systems of farming can be improved by small changes in husbandry, technology and management, and the process of investment and growth is smooth and scarcely perceptible. Pastoral improvement in New Zealand, on the other hand, usually relates to fairly large lumpy investment changes related to pasture development, bush clearing, topdressing and livestock development. These events take time to achieve a hence the pay back period is relatively long term. Some recent estimates show payback periods of 13-24 years depending on the vegetative cover to be cleared. The investment process has the further characteristic -that once started it has to be carried through to achieve any results at all. If interrupted, most of the benefits are lost. Expressed in terms of a series of costs and returns over a period of years, the early years show up as a period of cash deficits followed by a period of profit as the investment matures. Graph 3 shows the typical pattern that can be expected. To calculate the rate of return on investment in these circumstances, some form of cash flow analysis is required, such as discounting. In general the long maturity period of this kind of investment requires special encouragement and assistance if it is to be maintained at levels consistent with the national interest.
Traditionally Government played a major part in the land settlement process in New Zealand and not in the land development process. The legislation of the 1890?s breaking up the larger rural estates was concerned with settlement questions and not development. This was also true of the period of soldier settlement after World War I. In contrast the soldier settlement scheme after World War II combined both settlement and development objectives. Properties were ` bought, developed and then settled. Assistance was provided for further development. On the other hand, civilian settlement through the State Advances Corporation was largely concerned with financing purchase of farms right up to the mid 1960's. But in 1978, purchase loans only formed 36% of total rural lending by the Rural Banking and Finance Corporation which took over from the State Advances Corporation in 1973.
9.
There is thus considerable evidence that has been expressed elsewhere that agricultural development in New Zealand is largely autonomous in character. The theory is that the pioneer ethic was largely responsible for the production response in the past, hence government assistance could largely be devoted to providing an institutional framework which supported the desires of the migrant middle class who aspired to own land and work it. Thus, Government provided a straightforward land registration system, migration policies which ensured an adequate labour supply, and a financial system which ensured a settler could get a start in life. The rest was left to hard work, enterprise and not a little luck.
Events started to change in the early 1960?s. Static production levels were identified at the end of the 1950's and led up to the Agricultural Development Conference in 1963-64. This led to two significant changes in policy. Allowable expenses for tax purposes were extended to capital development A associated with the land, but not buildings and machinery. At the same time nil standard values were also introduced. Secondly, new lending policies for the rural section of the State Advances Corporation were introduced to encourage land development. It can be seen that the tax concessions were aimed at removing a disincentive to investment from the plough-back of farm revenues and the development funding was extending a principle already applied to the soldier settlement schemes.
The 1970?s have brought a new government approach. The Livestock Incentive Scheme (L.I.S.) was introduced in the 1976 Budget which actually subsidised the development process on pastoral farms. The intention again was to provide loan money during the formative stages of development, but to make it suspensory if certain expansion targets could be met. Farmers could take a livestock loan or claim a tax concession equivalent to double the grant provided. The significance of LIS was that it extended the 1963 provisions to those who did not pay tax as well as those that did. The 1978 Budget extended the LIS principle to land development in the Land Development Encouragement Loan Scheme. This scheme again tackles the impediment to development posed by the lumpy investment problem. Loans are provided on a suspensory basis for development of land out of bush scrub and tussock to a grass cover, up to a limit of $250 per hectare.
The 1978 Budget also made new moves to provide more certainty for farmers with long term development plans. This process had been started by the 1976 reform of the price stabilisation schemes where more concrete definitions of minimum prices and levy procedures were introduced. The Supplementary . Minimum Prices Scheme provides guaranteed prices for 2 years ahead as near as possible to levels which will ensure reasonable living standards for farmers.
l0.The evidence available to date suggests that the assistance provided in the last 3 years has markedly increased the ratio of capital investment to net farming income, but has not so far generated a positive increase in the volume of production, particularly pastoral production. Further analysis is obviously required on the production side of the equation as the investment process is working well, but results are needed. Programmes which achieve the best results in the national interest should be pursued.
This paper has shown that significant increases in real investment have taken place in recent years without a corresponding increase in output. There is considerable evidence for a diversification of capital away from the traditional livestock sector, and some evidence that buildings have increased as a proportion of total investment. The evidence is not conclusive and further detailed investigation is required.
The analysis of investment in plant and machinery has shown that a definite cycle of replacement takes place in the New . Zealand farm sector. It seems clear that high incomes enable farmers to accelerate their rate of replacement of machinery, and once this is achieved further rises in income have no effect for some time until a new generation of machinery is required. It was further deduced that the efficiency with which farm machinery is used has been improving during the period as large increases in output took place at times when net machinery investment was static. The propensity to invest on New Zealand farms is closely related to normal income limits on farms. By and large, farmers rely on current earnings for their capital needs. The proportion of aggregate net income used for investment is high and has varied considerably in the period analysed. In the 1970's the proportion has risen to very high levels. The marginal propensity to invest out of current income is also high in New Zealand agriculture and is estimated to be about 45% of extra net income.
Government assistance to agricultural investment has taken a number of forms in recent years. In the 1960's full tax remission was introduced for land development expenditure along with a system of nil standard values. This period also saw a rapid expansion of state development lending. In the 1970?s more direct assistance measures have been introduced in the form of the Livestock Incentive Scheme and the Land Development Encouragement Loan Scheme. These provide for suspensory loans when approved development programmes are undertaken. Most recently, Government has introduced the Supplementary Minimum Price Scheme to offer farmers guaranted prices for 2 years ahead. This`package of measures is having a profound effect on rural investment and consequently development at the present time.
11Future policy should aim to consolidate the measures already introduced. There is scope for considerable rationalisation of agricultural development. Areas where gains could be made include programmes for noxious weed control, programmes for accelerated land settlement by young farmers, encouragement of settlement of Lands and Survey development blocks, seeking out development opportunities for state and private development, and investigation of better techniques of land improvement. At the same time it will be necessary to ensure that the financial support structure for farming is adequately provided for so that worthwhile projects are satisfactorily funded. Only by a combination of good planning, co-ordination of objectives and sufficient financial provision will any results be achieved.


TRIXIE (director/writer: Alan Rudolph; screenwriter: from a story by John Binder & Rudolph; cinematographer: Jan Kiesser; editor: Michael Ruscio; cast: Emily Watson (Trixie Zurbo), Dermot Mulroney (Dex Lang), Nick Nolte (Senator Drummond Avery), Nathan Lane (Kirk Stans), Brittany Murphy (Ruby Pearli), Lesley Ann Warren (Dawn Sloane), Will Patton (Red Rafferty); Runtime: 115; Sony Pictures Classics; 2000)
Reviewed by Dennis Schwartz
Offbeat film director Alan Rudolph (ChooseMe) makes films that require an acquired taste to fully enjoy. In this fluff piece, which the director calls a "screwball noir," it suffers mostly because its mixture of being a formula noir tale and a comic farce is overtaken by its forced comedy and a story that has little drama in it, but it perks up at times because of the charming performances by all concerned and the constant barrage of wacky dialogue.
Trixie (Emily Watson) is a simple-minded square espousing innocence with her wide-eyes, but by her constant misuse of language through the use of malapropisms, she becomes a comic figure. She came from Chicago with her misplaced Midwestern accent to be an undercover lakeside resort casino security guard somewhere in the Pacific Northwest. She is chewing the fat even when she's chewing gum, romancing a confused young lustful man and while on a murder case is desperately trying to overcome her lack of knowledge about romance.
 She befriends a lounge comic Kirk (Nathan Lane), who offers her platonic-paternal counseling. His shopworn act of imitating celebrities' well-known sayings, is the pits. Dex (Dermot Mulroney) is a young Romeo bumbler who picks her up in the casino and arouses the young virgin's sexual interest. Dawn (Lesley Anne Warren) is a kept woman, enamored by her own sexiness though not particularly liking sex and, on top of that, is a pill-popping, mediocre pop-country singer. Red Rafferty (Will Patton) is a sleazy real estate developer and a small time gangster, who keeps Dawn as his mistress and has Dex as his lackey attendant. The femme fatale role falls to the spurned lover of Dex, the one who had his child, barfly Ruby (Brittany Murphy). Senator Drummond Avery (Nolte) is the incarnation of a white-maned politician who is both lecherous and corrupt, and he is the partner of Red in debauchery and in smelly land deals. He is in the habit of excusing his indiscretions by pointing out other politicians who had affairs on the side, like Ike and FDR and how that didn't prevent them from doing their job.
The film starts off in an amusingly pleasant way, as Trixie's banter is laced with continuous malapropisms such as, 'By hook or ladder,' 'He smokes like a fish,' and 'Nobody is human.' But this one-joke idea of a film soon starts to wear thin and the laughs become harder to get, as her malapropisms come with every sentence she utters and eventually bring the film down.
The film's strongest scene is set on Red's boat, where violence and a possible sense of an orgy happening clouds the pleasure cruise. It culminates in Trixie attacking Red for pinching her and of Dex coming to her aid, and of them getting kicked off the boat by the hired thugs Red employs.
When Dawn disappears, Trixie tracks her down and learns of a videotape she has of a sexually incriminating act, which she has hidden and is using it as a means of blackmail for money. After Trixie locates the tape, Dawn is thrown out of the hotel window she had been hiding out in and Trixie decides that she must solve the murder. To do this, she joins the martini drinking senator in the upscale restaurant he frequents and from there on the film turns into a suspense story, as Trixie begins to unravel the mystery of the murder. Unfortunately, the picture itself also unravels.
This is an actor's picture, where they are given every chance to do their thing, even if it results in over-acting. Emily Watson is featured in every scene and makes the best of what she's given to work with. Nick Nolte hams it up and unmercifully chews-the-scenery whenever he can, especially when ranting about his impoverished childhood and the peccadilloes of other politicians. The film was mildly enjoyable, but could have been much better if Rudolph tried to put a coherent story together instead of just going for cheap comedy.
REVIEWED ON 1/30/2001 GRADE: C
Dennis Schwartz: "Ozus' World Movie Reviews"
http://www.sover.net/~ozus
<EMAIL_ADDRESS>© ALL RIGHTS RESERVED DENNIS SCHWARTZ
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Extend Cache PDFs
Configuration
The 'Extend Cache PDFs' filter is enabled by specifying:
- Apache:
ModPagespeedEnableFilters extend_cache_pdfs
- Nginx:
pagespeed EnableFilters extend_cache_pdfs;
Description
'Extend Cache PDFs' is a version of Extend
Cache that acts on PDFs. Unlike 'Extend Cache' it applies not only to
resources but also to hyperlinks. For example, while 'Extend Cache' would not
apply to
, 'Extend Cache
PDFs' would apply to
.
Operation
Extend Cache: Operation describes the standard operation of cache extension in PageSpeed. This filter identifies PDF URLs by their ".pdf" extension and marks them as eligible for cache extension.
Example
You can see the filter in action at www.modpagespeed.com
for
cache-extending PDFs
in HTML.
Limitations
In addition to the limitations of Extend Cache, this filter is limited by its reliance on file extensions for identifying potential PDF URLs. PDF resources with URLs ending in something other than ".pdf" won't be considered for cache extension.
Risks
This filter has the same risks as Extend Cache.


Crystal structure of orthorhombic β-SiB 3. B and Si atoms are depicted as green and red circles, respectively. Zigzag chains of rhomboid Si 4 rings are indicated by red bonds. Terminal 2c2e (exo) bonds between icosahedra and between B and Si atoms are drawn in gray and yellow, respectively.


|
QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.30
|
Loss distribution with Monte Carlo simulation. More...
#include <ql/experimental/credit/lossdistribution.hpp>
Public Member Functions | |
| LossDistMonteCarlo (Size nBuckets, Real maximum, Size simulations, long seed=42, Real epsilon=1e-6) | |
| Distribution | operator() (const std::vector< Real > &volumes, const std::vector< Real > &probabilities) const override |
| Size | buckets () const override |
| Real | maximum () const override |
| Public Member Functions inherited from LossDist | |
| LossDist ()=default | |
| virtual | ~LossDist ()=default |
| virtual Distribution | operator() (const std::vector< Real > &volumes, const std::vector< Real > &probabilities) const =0 |
| virtual Size | buckets () const =0 |
| virtual Real | maximum () const =0 |
Private Attributes | |
| Size | nBuckets_ |
| Real | maximum_ |
| Size | simulations_ |
| long | seed_ |
| Real | epsilon_ |
Additional Inherited Members | |
| Static Public Member Functions inherited from LossDist | |
| static Real | binomialProbabilityOfNEvents (int n, std::vector< Real > &p) |
| static Real | binomialProbabilityOfAtLeastNEvents (int n, std::vector< Real > &p) |
| static std::vector< Real > | probabilityOfNEvents (std::vector< Real > &p) |
| static Real | probabilityOfNEvents (int n, std::vector< Real > &p) |
| static Real | probabilityOfAtLeastNEvents (int n, std::vector< Real > &p) |
Loss distribution with Monte Carlo simulation.
Loss distribution for varying volumes and probabilities of default via Monte Carlo simulation of independent default events.
Definition at line 205 of file lossdistribution.hpp.
| LossDistMonteCarlo | ( | Size | nBuckets, |
| Real | maximum, | ||
| Size | simulations, | ||
| long | seed = 42 , |
||
| Real | epsilon = 1e-6 |
||
| ) |
Definition at line 207 of file lossdistribution.hpp.
|
overridevirtual |
Implements LossDist.
Definition at line 302 of file lossdistribution.cpp.
|
overridevirtual |
Implements LossDist.
Definition at line 213 of file lossdistribution.hpp.
|
overridevirtual |
Implements LossDist.
Definition at line 214 of file lossdistribution.hpp.
|
private |
Definition at line 217 of file lossdistribution.hpp.
|
private |
Definition at line 218 of file lossdistribution.hpp.
|
private |
Definition at line 219 of file lossdistribution.hpp.
|
private |
Definition at line 220 of file lossdistribution.hpp.
|
private |
Definition at line 221 of file lossdistribution.hpp.


Suddenly Opportunities are Reachable (SOAR) is a leadership conference which focuses on helping middle school students effectively transition into high school.
Delegates attending SOAR will receive valuable insight and advice about high school life, all while participating in fun leadership activities and workshops. In addition, they will learn about extra curricular opportunities they can pursue throughout their high school years, and meet motivational speakers to inspire them to become involved in the community. The day is full of food, fun, and dancing.Join us on Saturday, June 1st at Turner Fenton Secondary School to learn to how you can make your high school experience as amazing as possible!


Open Source project contribution focuses a lot on the code committed to projects, but there is so much more that goes on behind the scenes that is just as valuable to FOSS than the code itself.
LABHR seeks to find those that provide these non-code contributions, and thank them.
Origins
LABHR started as an idea by Leslie Hawthorn. She advocates openly thanking people on social media, and writing recommendations.
This idea was extended by Katie McLaughlin with her work on automating this process on GitHub.
Projects
You can automate finding who to thank for their work on your FOSS projects by using one of the LABHR tools:
- hatrack - a web-based GitHub non-code contribution groker
- octohatrack - a python-cli based GitHub non-code contribution groker
- stackoverflow hat rack - visualise the most active users for a tag on StackOverflow
- wikipedia hat rack - visualise the contributors to a Wikipedia page
Articles
- A place to hang your hat - Leslie Hawthorn
- Recommendations Update - Leslie Hawthorn
- A tool for tracking non-code GitHub contributions - Katie McLaughlin
- Acknowledging Non-Coding Contributions - Katie McLaughlin
Talks and Presentations
- Build A Better Hat Rack - All Contributions Welcome presented at PyCon US
- Build A Better Hat Rack - All Contributions Welcome presented at Kiwi PyCon
- Build A Better Hat Rack - All Contributions Welcome presented at /dev/world/
- Build A Better Hat Rack - All Contributions Welcome presented at PyCon AU
- Mentioned in FOSS Lessions from building the KSP-CKAN by Paul Fenwick at OSDC
- Mentioned in Keynote by Dr Russell Keith-Magee at Django Under the Hood
- Lightning Talks have been presented at: SydPHP, DevOps Sydney, SyPy, /dev/world, PHP Conference NZ, OSDC, linux.conf.au, and DjangoCon Europe


|
libcoap 4.3.1
|
API for Application Input / Output checking. More...
Macros | |
| #define | COAP_IO_WAIT 0 |
| #define | COAP_IO_NO_WAIT ((uint32_t)-1) |
Functions | |
| int | coap_io_process (coap_context_t *ctx, uint32_t timeout_ms) |
| The main I/O processing function. More... | |
| int | coap_io_process_with_fds (coap_context_t *ctx, uint32_t timeout_ms, int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds) |
| The main message processing loop with additional fds for internal select. More... | |
API for Application Input / Output checking.
| int coap_io_process | ( | coap_context_t * | ctx, |
| uint32_t | timeout_ms | ||
| ) |
The main I/O processing function.
All pending network I/O is completed, and then optionally waits for the next input packet.
This internally calls coap_io_prepare_io(), then select() for the appropriate sockets, updates COAP_SOCKET_CAN_xxx where appropriate and then calls coap_io_do_io() before returning with the time spent in the function.
Alternatively, if libcoap is compiled with epoll support, this internally calls coap_io_prepare_epoll(), then epoll_wait() for waiting for any file descriptors that have (internally) been set up with epoll_ctl() and finally coap_io_do_epoll() before returning with the time spent in the function.
| ctx | The CoAP context |
| timeout_ms | Minimum number of milliseconds to wait for new packets before returning after doing any processing. If COAP_IO_WAIT, the call will block until the next internal action (e.g. packet retransmit) if any, or block until the next packet is received whichever is the sooner and do the necessary processing. If COAP_IO_NO_WAIT, the function will return immediately after processing without waiting for any new input packets to arrive. |
-1
if there was an error Definition at line 1360 of file coap_io.c.
| int coap_io_process_with_fds | ( | coap_context_t * | ctx, |
| uint32_t | timeout_ms, | ||
| int | nfds, | ||
| fd_set * | readfds, | ||
| fd_set * | writefds, | ||
| fd_set * | exceptfds | ||
| ) |
The main message processing loop with additional fds for internal select.
| ctx | The CoAP context |
| timeout_ms | Minimum number of milliseconds to wait for new packets before returning after doing any processing. If COAP_IO_WAIT, the call will block until the next internal action (e.g. packet retransmit) if any, or block until the next packet is received whichever is the sooner and do the necessary processing. If COAP_IO_NO_WAIT, the function will return immediately after processing without waiting for any new input packets to arrive. |
| nfds | The maximum FD set in readfds, writefds or exceptfds plus one, |
| readfds | Read FDs to additionally check for in internal select() or NULL if not required. |
| writefds | Write FDs to additionally check for in internal select() or NULL if not required. |
| exceptfds | Except FDs to additionally check for in internal select() or NULL if not required. |
-1
if there was an error. If defined, readfds, writefds, exceptfds are updated as returned by the internal select() call. Definition at line 1365 of file coap_io.c.


A true EDA story...
Quick Intro about myself:
I'm John Sengson. A proud kiwi that grew up from the Philippines. I came to follow my family here in NZ back in 2001. Met a wonderful Samoan lady and blessed with 2 young healthy kids. Im currently a student at EDA.
Bit of a background
I was in the retail industry for the last 15+ years. I felt that I need a change in my life and career. I always have interest in computers and pursued a new path with EDA. Leaving retail for web development was a tough decision, not just because I only have limited coding knowledge but also I am my family's bread winner. This is my journey as a student, a dad, and an aspiring web developer, all at a young age of 35!
Sharing my experience:
This is my official blog page. I will write about my experience as a full time student in EDA Auckland Campus.
I am a very frank person. Sometimes I can come across too straight forward. So just a warning, what your about to read is no holds barred/ censorship reading material. Don't get your hopes too high expecting a novel prize winner article either. I mean that what you read is basically what I will say as if we are having a convo. That's the real essence of a blog- raw and unedited.
If you have been following me from day 1 , you may notice this page gradually change in layout and contents. This is because this, along with my EDA pages will improve/ change base on what I learn. Putting it simply, it means my page will improve in visuals, responsiveness, and accessibility. It makes me excited just thinking about it! I hope you enjoy the pages I made as much as I do.
Already curious what I have been blabbing about? Click the links below for more deeper reading:
Links will go "live" as I go further within my 15 week course.


godot
An open source 2D and 3D game engine.
More information: home page
- Run a project if the current directory contains a `project.godot` file, otherwise open the project manager:
godot
- Edit a project (the current directory must contain a `project.godot` file):
godot -e
- Open the project manager even if the current directory contains a `project.godot` file:
godot -p
- Export a project for a given export preset (the preset must be defined in the project):
godot --export preset output_path
- Execute a standalone GDScript file (the script must inherit from `SceneTree` or `MainLoop`):
godot -s script.gd


--- layout: post title: Mozilla joins anti-SOPA protest categories: - news tags: - mozilla status: publish type: post published: true meta: _edit_last: '2' author: login: cray email<EMAIL_ADDRESS>display_name: cray first_name: '' last_name: '' ---
Just like the title says, Mozilla have joined the anti-SOPA protest and this is what Firefox shows you, when launched:
And there is also the warning on the mozilla.org site. As they say in Internets, do call you congressman and ask what is he/she going to do about the SOPA. Do that, really.
As for us, who owns only little blogs on their own, there is still a chance to be banned in case of any copyrighted content will be found on our sites. So, good luck with the protest, we are hoping for the best. Amen!


|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.Scanner
public final class Scanner
A simple text scanner which can parse primitive types and strings using regular expressions.
A Scanner
breaks its input into tokens using a
delimiter pattern, which by default matches whitespace. The resulting
tokens may then be converted into values of different types using the
various next methods.
For example, this code allows a user to read a number from System.in:
Scanner sc = new Scanner(System.in); int i = sc.nextInt();
As another example, this code allows long
types to be
assigned from entries in a file myNumbers
:
Scanner sc = new Scanner(new File("myNumbers")); while (sc.hasNextLong()) { long aLong = sc.nextLong(); }
The scanner can also use delimiters other than whitespace. This example reads several items in from a string:
String input = "1 fish 2 fish red fish blue fish"; Scanner s = new Scanner(input).useDelimiter("\\s*fish\\s*"); System.out.println(s.nextInt()); System.out.println(s.nextInt()); System.out.println(s.next()); System.out.println(s.next()); s.close();
prints the following output:
1 2 red blue
The same output can be generated with this code, which uses a regular expression to parse all four tokens at once:
String input = "1 fish 2 fish red fish blue fish"; Scanner s = new Scanner(input); s.findInLine("(\\d+) fish (\\d+) fish (\\w+) fish (\\w+)"); MatchResult result = s.match(); for (int i=1; i<=result.groupCount(); i++) System.out.println(result.group(i); s.close();
The default whitespace delimiter used by a scanner is as
recognized by Character
.isWhitespace
.
A scanning operation may block waiting for input.
The next()
and hasNext()
methods and their
primitive-type companion methods (such as nextInt()
and
hasNextInt()
) first skip any input that matches the delimiter
pattern, and then attempt to return the next token. Both hasNext
and next methods may block waiting for further input. Whether a
hasNext method blocks has no connection to whether or not its
associated next method will block.
The findInLine(java.lang.String)
, findWithinHorizon(java.lang.String, int)
, and skip(java.util.regex.Pattern)
methods operate independently of the delimiter pattern. These methods will
attempt to match the specified pattern with no regard to delimiters in the
input and thus can be used in special circumstances where delimiters are
not relevant. These methods may block waiting for more input.
When a scanner throws an InputMismatchException
, the scanner
will not pass the token that caused the exception, so that it may be
retrieved or skipped via some other method.
Depending upon the type of delimiting pattern, empty tokens may be returned. For example, the pattern "\\s+" will return no empty tokens since it matches multiple instances of the delimiter. The delimiting pattern "\\s" could return empty tokens since it only passes one space at a time.
A scanner can read text from any object which implements the Readable
interface. If an invocation of the underlying
readable's Readable.read(java.nio.CharBuffer)
method throws an IOException
then the scanner assumes that the end of the input
has been reached. The most recent IOException thrown by the
underlying readable can be retrieved via the ioException()
method.
When a Scanner
is closed, it will close its input source
if the source implements the Closeable
interface.
A Scanner
is not safe for multithreaded use without
external synchronization.
Unless otherwise mentioned, passing a null
parameter into
any method of a Scanner
will cause a
NullPointerException
to be thrown.
A scanner will default to interpreting numbers as decimal unless a
different radix has been set by using the An instance of this class is capable of scanning numbers in the standard
formats as well as in the formats of the scanner's locale. A scanner's
initial locale is the value returned by the The localized formats are defined in terms of the following parameters,
which for a particular locale are taken from that locale's The strings that can be parsed as numbers by an instance of this class
are specified in terms of the following regular-expression grammar, where
Rmax is the highest digit in the radix being used (for example, Rmax is 9
in base 10).
useRadix(int)
method.
Localized numbers
Locale.getDefault()
method; it may be changed via the useLocale(java.util.Locale)
method.
DecimalFormat
object, df, and its and
DecimalFormatSymbols
object,
dfs.
LocalGroupSeparator
The character used to separate thousands groups,
i.e., dfs. getGroupingSeparator()
LocalDecimalSeparator
The character used for the decimal point,
i.e., dfs. getDecimalSeparator()
LocalPositivePrefix
The string that appears before a positive number (may
be empty), i.e., df. getPositivePrefix()
LocalPositiveSuffix
The string that appears after a positive number (may be
empty), i.e., df. getPositiveSuffix()
LocalNegativePrefix
The string that appears before a negative number (may
be empty), i.e., df. getNegativePrefix()
LocalNegativeSuffix
The string that appears after a negative number (may be
empty), i.e., df. getNegativeSuffix()
LocalNaN
The string that represents not-a-number for
floating-point values,
i.e., dfs. getInfinity()
LocalInfinity
The string that represents infinity for floating-point
values, i.e., dfs. getInfinity()
Number syntax
| NonASCIIDigit :: | = A non-ASCII character c for which
Character.isDigit (c)
returns true | ||||
| Non0Digit :: | = [1-Rmax] | NonASCIIDigit | ||||
| Digit :: | = [0-Rmax] | NonASCIIDigit | ||||
| GroupedNumeral :: |
| ||||
| Numeral :: | = ( ( Digit+ ) | GroupedNumeral ) | ||||
| Integer :: | = ( [-+]? ( Numeral ) ) | ||||
| | LocalPositivePrefix Numeral LocalPositiveSuffix | |||||
| | LocalNegativePrefix Numeral LocalNegativeSuffix | |||||
| DecimalNumeral :: | = Numeral | ||||
| | Numeral LocalDecimalSeparator Digit* | |||||
| | LocalDecimalSeparator Digit+ | |||||
| Exponent :: | = ( [eE] [+-]? Digit+ ) | ||||
| Decimal :: | = ( [-+]? DecimalNumeral Exponent? ) | ||||
| | LocalPositivePrefix DecimalNumeral LocalPositiveSuffix Exponent? | |||||
| | LocalNegativePrefix DecimalNumeral LocalNegativeSuffix Exponent? | |||||
| HexFloat :: | = [-+]? 0[xX][0-9a-fA-F]*\.[0-9a-fA-F]+ ([pP][-+]?[0-9]+)? | ||||
| NonNumber :: | = NaN | LocalNan | Infinity | LocalInfinity | ||||
| SignedNonNumber :: | = ( [-+]? NonNumber ) | ||||
| | LocalPositivePrefix NonNumber LocalPositiveSuffix | |||||
| | LocalNegativePrefix NonNumber LocalNegativeSuffix | |||||
| Float :: | = Decimal | ||||
| | HexFloat | |||||
| | SignedNonNumber |
Whitespace is not significant in the above regular expressions.
| Constructor Summary | |
|---|---|
Scanner(File source)
Constructs a new Scanner that produces values scanned
from the specified file. |
|
Scanner(File source,
String charsetName)
Constructs a new Scanner that produces values scanned
from the specified file. |
|
Scanner(InputStream source)
Constructs a new Scanner that produces values scanned
from the specified input stream. |
|
Scanner(InputStream source,
String charsetName)
Constructs a new Scanner that produces values scanned
from the specified input stream. |
|
Scanner(Readable source)
Constructs a new Scanner that produces values scanned
from the specified source. |
|
Scanner(ReadableByteChannel source)
Constructs a new Scanner that produces values scanned
from the specified channel. |
|
Scanner(ReadableByteChannel source,
String charsetName)
Constructs a new Scanner that produces values scanned
from the specified channel. |
|
Scanner(String source)
Constructs a new Scanner that produces values scanned
from the specified string. |
| Method Summary | |
|---|---|
void |
close()
Closes this scanner. |
Pattern |
delimiter()
Returns the Pattern this Scanner is currently
using to match delimiters. |
String |
findInLine(Pattern pattern)
Attempts to find the next occurrence of the specified pattern ignoring delimiters. |
String |
findInLine(String pattern)
Attempts to find the next occurrence of a pattern constructed from the specified string, ignoring delimiters. |
String |
findWithinHorizon(Pattern pattern,
int horizon)
Attempts to find the next occurrence of the specified pattern. |
String |
findWithinHorizon(String pattern,
int horizon)
Attempts to find the next occurrence of a pattern constructed from the specified string, ignoring delimiters. |
boolean |
hasNext()
Returns true if this scanner has another token in its input. |
boolean |
hasNext(Pattern pattern)
Returns true if the next complete token matches the specified pattern. |
boolean |
hasNext(String pattern)
Returns true if the next token matches the pattern constructed from the specified string. |
boolean |
hasNextBigDecimal()
Returns true if the next token in this scanner's input can be interpreted as a BigDecimal using the
nextBigDecimal() method. |
boolean |
hasNextBigInteger()
Returns true if the next token in this scanner's input can be interpreted as a BigInteger in the default radix using the
nextBigInteger() method. |
boolean |
hasNextBigInteger(int radix)
Returns true if the next token in this scanner's input can be interpreted as a BigInteger in the specified radix using
the nextBigInteger() method. |
boolean |
hasNextBoolean()
Returns true if the next token in this scanner's input can be interpreted as a boolean value using a case insensitive pattern created from the string "true|false". |
boolean |
hasNextByte()
Returns true if the next token in this scanner's input can be interpreted as a byte value in the default radix using the nextByte() method. |
boolean |
hasNextByte(int radix)
Returns true if the next token in this scanner's input can be interpreted as a byte value in the specified radix using the nextByte() method. |
boolean |
hasNextDouble()
Returns true if the next token in this scanner's input can be interpreted as a double value using the nextDouble()
method. |
boolean |
hasNextFloat()
Returns true if the next token in this scanner's input can be interpreted as a float value using the nextFloat()
method. |
boolean |
hasNextInt()
Returns true if the next token in this scanner's input can be interpreted as an int value in the default radix using the nextInt() method. |
boolean |
hasNextInt(int radix)
Returns true if the next token in this scanner's input can be interpreted as an int value in the specified radix using the nextInt() method. |
boolean |
hasNextLine()
Returns true if there is another line in the input of this scanner. |
boolean |
hasNextLong()
Returns true if the next token in this scanner's input can be interpreted as a long value in the default radix using the nextLong() method. |
boolean |
hasNextLong(int radix)
Returns true if the next token in this scanner's input can be interpreted as a long value in the specified radix using the nextLong() method. |
boolean |
hasNextShort()
Returns true if the next token in this scanner's input can be interpreted as a short value in the default radix using the nextShort() method. |
boolean |
hasNextShort(int radix)
Returns true if the next token in this scanner's input can be interpreted as a short value in the specified radix using the nextShort() method. |
IOException |
ioException()
Returns the IOException last thrown by this
Scanner 's underlying Readable . |
Locale |
locale()
Returns this scanner's locale. |
MatchResult |
match()
Returns the match result of the last scanning operation performed by this scanner. |
String |
next()
Finds and returns the next complete token from this scanner. |
String |
next(Pattern pattern)
Returns the next token if it matches the specified pattern. |
String |
next(String pattern)
Returns the next token if it matches the pattern constructed from the specified string. |
BigDecimal |
nextBigDecimal()
Scans the next token of the input as a BigDecimal . |
BigInteger |
nextBigInteger()
Scans the next token of the input as a BigInteger . |
BigInteger |
nextBigInteger(int radix)
Scans the next token of the input as a BigInteger . |
boolean |
nextBoolean()
Scans the next token of the input into a boolean value and returns that value. |
byte |
nextByte()
Scans the next token of the input as a byte. |
byte |
nextByte(int radix)
Scans the next token of the input as a byte. |
double |
nextDouble()
Scans the next token of the input as a double. |
float |
nextFloat()
Scans the next token of the input as a float. |
int |
nextInt()
Scans the next token of the input as an int. |
int |
nextInt(int radix)
Scans the next token of the input as an int. |
String |
nextLine()
Advances this scanner past the current line and returns the input that was skipped. |
long |
nextLong()
Scans the next token of the input as a long. |
long |
nextLong(int radix)
Scans the next token of the input as a long. |
short |
nextShort()
Scans the next token of the input as a short. |
short |
nextShort(int radix)
Scans the next token of the input as a short. |
int |
radix()
Returns this scanner's default radix. |
void |
remove()
The remove operation is not supported by this implementation of Iterator . |
Scanner |
skip(Pattern pattern)
Skips input that matches the specified pattern, ignoring delimiters. |
Scanner |
skip(String pattern)
Skips input that matches a pattern constructed from the specified string. |
String |
toString()
Returns the string representation of this Scanner . |
Scanner |
useDelimiter(Pattern pattern)
Sets this scanner's delimiting pattern to the specified pattern. |
Scanner |
useDelimiter(String pattern)
Sets this scanner's delimiting pattern to a pattern constructed from the specified String . |
Scanner |
useLocale(Locale locale)
Sets this scanner's locale to the specified locale. |
Scanner |
useRadix(int radix)
Sets this scanner's default radix to the specified radix. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Scanner(Readable source)
Scanner
that produces values scanned
from the specified source.
source
- A character source implementing the Readable
interfacepublic Scanner(InputStream source)
Scanner
that produces values scanned
from the specified input stream. Bytes from the stream are converted
into characters using the underlying platform's
default charset.
source
- An input stream to be scannedpublic Scanner(InputStream source, String charsetName)
Scanner
that produces values scanned
from the specified input stream. Bytes from the stream are converted
into characters using the specified charset.
source
- An input stream to be scannedcharsetName
- The encoding type used to convert bytes from the
stream into characters to be scanned
IllegalArgumentException
- if the specified character set
does not existpublic Scanner(File source) throws FileNotFoundException
Scanner
that produces values scanned
from the specified file. Bytes from the file are converted into
characters using the underlying platform's
default charset.
source
- A file to be scanned
FileNotFoundException
- if source is not foundpublic Scanner(File source, String charsetName) throws FileNotFoundException
Scanner
that produces values scanned
from the specified file. Bytes from the file are converted into
characters using the specified charset.
source
- A file to be scannedcharsetName
- The encoding type used to convert bytes from the file
into characters to be scanned
FileNotFoundException
- if source is not found
IllegalArgumentException
- if the specified encoding is
not foundpublic Scanner(String source)
Scanner
that produces values scanned
from the specified string.
source
- A string to scanpublic Scanner(ReadableByteChannel source)
Scanner
that produces values scanned
from the specified channel. Bytes from the source are converted into
characters using the underlying platform's
default charset.
source
- A channel to scanpublic Scanner(ReadableByteChannel source, String charsetName)
Scanner
that produces values scanned
from the specified channel. Bytes from the source are converted into
characters using the specified charset.
source
- A channel to scancharsetName
- The encoding type used to convert bytes from the
channel into characters to be scanned
IllegalArgumentException
- if the specified character set
does not exist| Method Detail |
|---|
public void close()
If this scanner has not yet been closed then if its underlying
readable also implements the Closeable
interface then the readable's close method
will be invoked. If this scanner is already closed then invoking this
method will have no effect.
Attempting to perform search operations after a scanner has
been closed will result in an IllegalStateException
.
public IOException ioException()
IOException
last thrown by this
Scanner
's underlying Readable
. This method
returns null
if no such exception exists.
public Pattern delimiter()
Pattern
this Scanner
is currently
using to match delimiters.
public Scanner useDelimiter(Pattern pattern)
pattern
- A delimiting pattern
public Scanner useDelimiter(String pattern)
String
.
An invocation of this method of the form useDelimiter(pattern) behaves in exactly the same way as the invocation hasDelimiter(Pattern.compile(pattern)).
pattern
- A string specifying a delimiting pattern
public Locale locale()
A scanner's locale affects many elements of its default primitive matching regular expressions; see localized numbers above.
public Scanner useLocale(Locale locale)
A scanner's locale affects many elements of its default primitive matching regular expressions; see localized numbers above.
locale
- A string specifying the locale to use
public int radix()
A scanner's radix affects elements of its default number matching regular expressions; see localized numbers above.
public Scanner useRadix(int radix)
A scanner's radix affects elements of its default number matching regular expressions; see localized numbers above.
If the radix is less than Character.MIN_RADIX
or greater than Character.MAX_RADIX
, then an
IllegalArgumentException
is thrown.
radix
- The radix to use when scanning numbers
IllegalArgumentException
- if radix is out of rangepublic MatchResult match()
IllegalStateException
if no match has been performed, or if the last match was
not successful.
The various next
methods of Scanner
make a match result available if they complete without throwing an
exception. For instance, after an invocation of the nextInt()
method that returned an int, this method returns a
MatchResult
for the search of the
Integer regular expression
defined above. Similarly the findInLine(java.lang.String)
,
findWithinHorizon(java.lang.String, int)
, and skip(java.util.regex.Pattern)
methods will make a
match available if they succeed.
IllegalStateException
- If no match result is availablepublic String toString()
Returns the string representation of this Scanner
. The
string representation of a Scanner
contains information
that may be useful for debugging. The exact format is unspecified.
toString
in class Object
public boolean hasNext()
hasNext
in interface Iterator<String>
IllegalStateException
- if this scanner is closedIterator
public String next()
hasNext()
returned
true
.
next
in interface Iterator<String>
NoSuchElementException
- if no more tokens are available
IllegalStateException
- if this scanner is closedIterator
public void remove()
Iterator
.
remove
in interface Iterator<String>
UnsupportedOperationException
- if this method is invoked.Iterator
public boolean hasNext(String pattern)
An invocation of this method of the form hasNext(pattern) behaves in exactly the same way as the invocation hasNext(Pattern.compile(pattern)).
pattern
- a string specifying the pattern to scan
IllegalStateException
- if this scanner is closedpublic String next(String pattern)
An invocation of this method of the form next(pattern) behaves in exactly the same way as the invocation next(Pattern.compile(pattern)).
pattern
- a string specifying the pattern to scan
NoSuchElementException
- if no such tokens are available
IllegalStateException
- if this scanner is closedpublic boolean hasNext(Pattern pattern)
pattern
- the pattern to scan for
IllegalStateException
- if this scanner is closedpublic String next(Pattern pattern)
hasNext(Pattern)
returned true
.
If the match is successful, the scanner advances past the input that
matched the pattern.
pattern
- the pattern to scan for
NoSuchElementException
- if no more tokens are available
IllegalStateException
- if this scanner is closedpublic boolean hasNextLine()
IllegalStateException
- if this scanner is closedpublic String nextLine()
Since this method continues to search through the input looking for a line separator, it may buffer all of the input searching for the line to skip if no line separators are present.
NoSuchElementException
- if no line was found
IllegalStateException
- if this scanner is closedpublic String findInLine(String pattern)
An invocation of this method of the form findInLine(pattern) behaves in exactly the same way as the invocation findInLine(Pattern.compile(pattern)).
pattern
- a string specifying the pattern to search for
IllegalStateException
- if this scanner is closedpublic String findInLine(Pattern pattern)
null
is returned and the scanner's
position is unchanged. This method may block waiting for input that
matches the pattern.
Since this method continues to search through the input looking for the specified pattern, it may buffer all of the input searching for the desired token if no line separators are present.
pattern
- the pattern to scan for
IllegalStateException
- if this scanner is closedpublic String findWithinHorizon(String pattern, int horizon)
An invocation of this method of the form findWithinHorizon(pattern) behaves in exactly the same way as the invocation findWithinHorizon(Pattern.compile(pattern, horizon)).
pattern
- a string specifying the pattern to search for
IllegalStateException
- if this scanner is closed
IllegalArgumentException
- if horizon is negativepublic String findWithinHorizon(Pattern pattern, int horizon)
This method searches through the input up to the specified search horizon, ignoring delimiters. If the pattern is found the scanner advances past the input that matched and returns the string that matched the pattern. If no such pattern is detected then the null is returned and the scanner's position remains unchanged. This method may block waiting for input that matches the pattern.
A scanner will never search more than horizon
code
points beyond its current position. Note that a match may be clipped
by the horizon; that is, an arbitrary match result may have been
different if the horizon had been larger. The scanner treats the
horizon as a transparent, non-anchoring bound (see Matcher.useTransparentBounds(boolean)
and Matcher.useAnchoringBounds(boolean)
).
If horizon is 0
, then the horizon is ignored and
this method continues to search through the input looking for the
specified pattern without bound. In this case it may buffer all of
the input searching for the pattern.
If horizon is negative, then an IllegalArgumentException is thrown.
pattern
- the pattern to scan for
IllegalStateException
- if this scanner is closed
IllegalArgumentException
- if horizon is negativepublic Scanner skip(Pattern pattern)
If a match to the specified pattern is not found at the current position, then no input is skipped and a NoSuchElementException is thrown.
Since this method seeks to match the specified pattern starting at the scanner's current position, patterns that can match a lot of input (".*", for example) may cause the scanner to buffer a large amount of input.
Note that it is possible to skip something without risking a
NoSuchElementException
by using a pattern that can
match nothing, e.g., sc.skip("[ \t]*")
.
pattern
- a string specifying the pattern to skip over
NoSuchElementException
- if the specified pattern is not found
IllegalStateException
- if this scanner is closedpublic Scanner skip(String pattern)
An invocation of this method of the form skip(pattern) behaves in exactly the same way as the invocation skip(Pattern.compile(pattern)).
pattern
- a string specifying the pattern to skip over
IllegalStateException
- if this scanner is closedpublic boolean hasNextBoolean()
IllegalStateException
- if this scanner is closedpublic boolean nextBoolean()
InputMismatchException
if the next token cannot be translated into a valid boolean value.
If the match is successful, the scanner advances past the input that
matched.
InputMismatchException
- if the next token is not a valid boolean
NoSuchElementException
- if input is exhausted
IllegalStateException
- if this scanner is closedpublic boolean hasNextByte()
nextByte()
method. The scanner does not advance past any input.
IllegalStateException
- if this scanner is closedpublic boolean hasNextByte(int radix)
nextByte()
method. The scanner does not advance past any input.
radix
- the radix used to interpret the token as a byte value
IllegalStateException
- if this scanner is closedpublic byte nextByte()
An invocation of this method of the form
nextByte() behaves in exactly the same way as the
invocation nextByte(radix), where radix
is the default radix of this scanner.
InputMismatchException
- if the next token does not match the Integer
regular expression, or is out of range
NoSuchElementException
- if input is exhausted
IllegalStateException
- if this scanner is closedpublic byte nextByte(int radix)
InputMismatchException
if the next token cannot be translated into a valid byte value as
described below. If the translation is successful, the scanner advances
past the input that matched.
If the next token matches the Integer regular expression defined
above then the token is converted into a byte value as if by
removing all locale specific prefixes, group separators, and locale
specific suffixes, then mapping non-ASCII digits into ASCII
digits via Character.digit
, prepending a
negative sign (-) if the locale specific negative prefixes and suffixes
were present, and passing the resulting string to
Byte.parseByte
with the
specified radix.
radix
- the radix used to interpret the token as a byte value
InputMismatchException
- if the next token does not match the Integer
regular expression, or is out of range
NoSuchElementException
- if input is exhausted
IllegalStateException
- if this scanner is closedpublic boolean hasNextShort()
nextShort()
method. The scanner does not advance past any input.
IllegalStateException
- if this scanner is closedpublic boolean hasNextShort(int radix)
nextShort()
method. The scanner does not advance past any input.
radix
- the radix used to interpret the token as a short value
IllegalStateException
- if this scanner is closedpublic short nextShort()
An invocation of this method of the form
nextShort() behaves in exactly the same way as the
invocation nextShort(radix), where radix
is the default radix of this scanner.
InputMismatchException
- if the next token does not match the Integer
regular expression, or is out of range
NoSuchElementException
- if input is exhausted
IllegalStateException
- if this scanner is closedpublic short nextShort(int radix)
InputMismatchException
if the next token cannot be translated into a valid short value as
described below. If the translation is successful, the scanner advances
past the input that matched.
If the next token matches the Integer regular expression defined
above then the token is converted into a short value as if by
removing all locale specific prefixes, group separators, and locale
specific suffixes, then mapping non-ASCII digits into ASCII
digits via Character.digit
, prepending a
negative sign (-) if the locale specific negative prefixes and suffixes
were present, and passing the resulting string to
Short.parseShort
with the
specified radix.
radix
- the radix used to interpret the token as a short value
InputMismatchException
- if the next token does not match the Integer
regular expression, or is out of range
NoSuchElementException
- if input is exhausted
IllegalStateException
- if this scanner is closedpublic boolean hasNextInt()
nextInt()
method. The scanner does not advance past any input.
IllegalStateException
- if this scanner is closedpublic boolean hasNextInt(int radix)
nextInt()
method. The scanner does not advance past any input.
radix
- the radix used to interpret the token as an int value
IllegalStateException
- if this scanner is closedpublic int nextInt()
An invocation of this method of the form
nextInt() behaves in exactly the same way as the
invocation nextInt(radix), where radix
is the default radix of this scanner.
InputMismatchException
- if the next token does not match the Integer
regular expression, or is out of range
NoSuchElementException
- if input is exhausted
IllegalStateException
- if this scanner is closedpublic int nextInt(int radix)
InputMismatchException
if the next token cannot be translated into a valid int value as
described below. If the translation is successful, the scanner advances
past the input that matched.
If the next token matches the Integer regular expression defined
above then the token is converted into an int value as if by
removing all locale specific prefixes, group separators, and locale
specific suffixes, then mapping non-ASCII digits into ASCII
digits via Character.digit
, prepending a
negative sign (-) if the locale specific negative prefixes and suffixes
were present, and passing the resulting string to
Integer.parseInt
with the
specified radix.
radix
- the radix used to interpret the token as an int value
InputMismatchException
- if the next token does not match the Integer
regular expression, or is out of range
NoSuchElementException
- if input is exhausted
IllegalStateException
- if this scanner is closedpublic boolean hasNextLong()
nextLong()
method. The scanner does not advance past any input.
IllegalStateException
- if this scanner is closedpublic boolean hasNextLong(int radix)
nextLong()
method. The scanner does not advance past any input.
radix
- the radix used to interpret the token as a long value
IllegalStateException
- if this scanner is closedpublic long nextLong()
An invocation of this method of the form
nextLong() behaves in exactly the same way as the
invocation nextLong(radix), where radix
is the default radix of this scanner.
InputMismatchException
- if the next token does not match the Integer
regular expression, or is out of range
NoSuchElementException
- if input is exhausted
IllegalStateException
- if this scanner is closedpublic long nextLong(int radix)
InputMismatchException
if the next token cannot be translated into a valid long value as
described below. If the translation is successful, the scanner advances
past the input that matched.
If the next token matches the Integer regular expression defined
above then the token is converted into an long value as if by
removing all locale specific prefixes, group separators, and locale
specific suffixes, then mapping non-ASCII digits into ASCII
digits via Character.digit
, prepending a
negative sign (-) if the locale specific negative prefixes and suffixes
were present, and passing the resulting string to
Long.parseLong
with the
specified radix.
radix
- the radix used to interpret the token as an int value
InputMismatchException
- if the next token does not match the Integer
regular expression, or is out of range
NoSuchElementException
- if input is exhausted
IllegalStateException
- if this scanner is closedpublic boolean hasNextFloat()
nextFloat()
method. The scanner does not advance past any input.
IllegalStateException
- if this scanner is closedpublic float nextFloat()
InputMismatchException
if the next token cannot be translated into a valid float value as
described below. If the translation is successful, the scanner advances
past the input that matched.
If the next token matches the Float regular expression defined above
then the token is converted into a float value as if by
removing all locale specific prefixes, group separators, and locale
specific suffixes, then mapping non-ASCII digits into ASCII
digits via Character.digit
, prepending a
negative sign (-) if the locale specific negative prefixes and suffixes
were present, and passing the resulting string to
Float.parseFloat
. If the token matches
the localized NaN or infinity strings, then either "Nan" or "Infinity"
is passed to Float.parseFloat
as
appropriate.
InputMismatchException
- if the next token does not match the Float
regular expression, or is out of range
NoSuchElementException
- if input is exhausted
IllegalStateException
- if this scanner is closedpublic boolean hasNextDouble()
nextDouble()
method. The scanner does not advance past any input.
IllegalStateException
- if this scanner is closedpublic double nextDouble()
InputMismatchException
if the next token cannot be translated into a valid double value.
If the translation is successful, the scanner advances past the input
that matched.
If the next token matches the Float regular expression defined above
then the token is converted into a double value as if by
removing all locale specific prefixes, group separators, and locale
specific suffixes, then mapping non-ASCII digits into ASCII
digits via Character.digit
, prepending a
negative sign (-) if the locale specific negative prefixes and suffixes
were present, and passing the resulting string to
Double.parseDouble
. If the token matches
the localized NaN or infinity strings, then either "Nan" or "Infinity"
is passed to Double.parseDouble
as
appropriate.
InputMismatchException
- if the next token does not match the Float
regular expression, or is out of range
NoSuchElementException
- if the input is exhausted
IllegalStateException
- if this scanner is closedpublic boolean hasNextBigInteger()
BigInteger
in the default radix using the
nextBigInteger()
method. The scanner does not advance past any
input.
BigInteger
IllegalStateException
- if this scanner is closedpublic boolean hasNextBigInteger(int radix)
BigInteger
in the specified radix using
the nextBigInteger()
method. The scanner does not advance past
any input.
radix
- the radix used to interpret the token as an integer
BigInteger
IllegalStateException
- if this scanner is closedpublic BigInteger nextBigInteger()
BigInteger
.
An invocation of this method of the form
nextBigInteger() behaves in exactly the same way as the
invocation nextBigInteger(radix), where radix
is the default radix of this scanner.
InputMismatchException
- if the next token does not match the Integer
regular expression, or is out of range
NoSuchElementException
- if the input is exhausted
IllegalStateException
- if this scanner is closedpublic BigInteger nextBigInteger(int radix)
BigInteger
.
If the next token matches the Integer regular expression defined
above then the token is converted into a BigInteger value as if
by removing all group separators, mapping non-ASCII digits into ASCII
digits via the Character.digit
, and passing the
resulting string to the BigInteger(String, int)
constructor with the specified radix.
radix
- the radix used to interpret the token
InputMismatchException
- if the next token does not match the Integer
regular expression, or is out of range
NoSuchElementException
- if the input is exhausted
IllegalStateException
- if this scanner is closedpublic boolean hasNextBigDecimal()
BigDecimal
using the
nextBigDecimal()
method. The scanner does not advance past any
input.
BigDecimal
IllegalStateException
- if this scanner is closedpublic BigDecimal nextBigDecimal()
BigDecimal
.
If the next token matches the Decimal regular expression defined
above then the token is converted into a BigDecimal value as if
by removing all group separators, mapping non-ASCII digits into ASCII
digits via the Character.digit
, and passing the
resulting string to the BigDecimal(String)
constructor.
InputMismatchException
- if the next token does not match the Decimal
regular expression, or is out of range
NoSuchElementException
- if the input is exhausted
IllegalStateException
- if this scanner is closed
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2004, 2010 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.